question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Enhancement]: expose onBlur event from input in Slider

See original GitHub issue

Summary

if anything, we would also like to be able to listen to the blur event for the input in slider.

Our use case: There are 2 sliders A and B. A determines the upper bound of B, while B determines the lower bound of A.

Show me the code: https://codesandbox.io/s/optimistic-pateu-1by45?file=/src/index.js

Imagine this scenario: A is 50, B is 70. when user sets ‘90’ on A by typing on the text box, onChange is called when ‘9’ is pressed and it immediately sets the B to 9 because B exceeds the new ‘upper bound’ which is ‘9’, but it’s executed prematurely. Adding a debounce/delay from consumer side would relieve some cases but it’s not a right fix IMHO. All is good when user drags the handle.

onBlur could solve this problem, because that’s when user is satisfied with the number and move on to next item

This is somewhat connected to https://github.com/carbon-design-system/carbon/issues/9898

Justification

We are implementing a double sliders for thresholds for a ML based business term/data class assignment and suggestion.

The first one being the threshold a model will assign the term to an asset. the second one is the threshold a model will list the term as suggestion, but not assigned.

If the confidence score of term X exceeds threshold A, then the term/data class would be assigned directly without user action. e.g s > A > B If the confidence score of term Y is between threshold A and B, then it will be added to a list for user to review later. e.g A > s > B

Desired UX and success metrics

No response

Required functionality

onBlur should can be called with the latest value

Specific timeline issues / requests

No response

Available extra resources

No response

Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nelsonchen90commented, Jan 11, 2022

@tay1orjones the codesandbox example is almost the same as our implementation. And you are right, we are working with two sliders, not dual handles in a single one because we are setting two distinct values instead of a range, although these two values does have constraint on each other.

0reactions
tay1orjonescommented, Oct 18, 2022

@nelsonchen90 Yeah we can backport the fix delivered in https://github.com/carbon-design-system/carbon/pull/11348 to v10

Read more comments on GitHub >

github_iconTop Results From Across the Web

Element: blur event - Web APIs | MDN
The blur event fires when an element has lost focus. The event does not bubble, but the related focusout event that follows does...
Read more >
Slider - jQuery Mobile - W3cubDocs
The framework will find all input elements with a type="range" and automatically enhance them into a slider with an accompanying input without any...
Read more >
Form Input | Components - BootstrapVue
Create various type inputs such as: text, password, number, url, email, ... the formatter function to being called on the control's native blur...
Read more >
How to handle the ValueChanged event and use forms and ...
Problem. Handling the ValueChanged event exposed from inputs interferes with two-way binding through @bind-Value and thus, with validation.
Read more >
Using the Emissive Material Input
Inside of Unreal Engine 4(UE4), Self-Illuminated Materials are known as Emissive Materials. In the following How-to guide, we will be covering how you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found