-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Slider] Major upgrade #15703
[Slider] Major upgrade #15703
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I wouldn't close #14674 at this point. As I understood React Fire |
f288e74
to
a9ed6a6
Compare
@oliviertassinari This looks great! I actually just found out today about a client request where they want a slider for something in our app. Are you planning on providing any support for Value entry field in the initial version? |
@ryancogswell It probably still need a day of work. I don't see anything specific with the value entry case. I have the following so far: https://deploy-preview-15703--material-ui.netlify.com/components/slider/. |
@oliviertassinari Sorry, I'm not sure I understand what you're saying. Are you saying you aren't doing anything yet for the value entry case, or that you don't see anything in the spec about the value entry case (i.e. ability to do text entry of the value when the slider has focus), or that you don't think this case needs anything specific within Slider to support? |
I don't think that it needs anything specific within the Slider support. What prevents you from having this use case with the existing lab component? |
@oliviertassinari I'm sure it's possible, but there are enough layout/styling concerns and potential complexities with tapping into the |
OK, I will add a demo. It should be about 1. Using the Grid component, 2. Using a debounce on the input changes. 3. Using the step prop for the input number type. |
805931c
to
b743904
Compare
@material-ui/lab: parsed: +1.08% , gzip: +1.45% Details of bundle changes.Comparing: 07b9d6e...d2bc0dc
|
ac58df1
to
372ff80
Compare
556c231
to
caa8ed6
Compare
Co-Authored-By: Sebastian Silbermann <silbermann.sebastian@gmail.com>
caa8ed6
to
c89da43
Compare
After clicking it still responds to keyboard input. This is a regression from the previous version and doesn't follow wai-aria authoring practices. |
@eps1lon I don't understand, can you clarify? In the following. The value starts around 0, I click around 80%. I press the up key command, then the down key command two times. |
Yeah you understood it. Native browser implementation is not following wai-aria as well. If there's a W3 spec for that behavior we can keep it (but need to display label again). So far browser implementations are most often not following specs or are different between vendors. They shouldn't be the most important reference. |
@eps1lon Can you clarify what the desired behavior is and which wai-aria authoring practices you are referring to? The wai-aria example (https://www.w3.org/TR/wai-aria-practices/examples/slider/slider-2.html) seems to behave the same way unless I'm misunderstanding what aspect you are focusing on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re the review request - nothing further from me at this point.
@eps1lon I just answered my own question with a little experimenting. To clarify for others, in the wai-aria example, if you click on the Slider thumb then keyboard focus is placed on the Slider (same as in this branch), but if you click elsewhere on the Slider it just changes the Slider position without giving it focus. When I was first trying to understand your point, I was clicking on the thumb and dragging it to change the value and then using the keyboard to change it further. In that case, keyboard focus behaves the same for the wai-aria example and this branch. |
| <span class="prop-name">value</span> | <span class="prop-type">union: number |<br> arrayOf<br></span> | | The value of the slider. For ranged sliders, provide an array with two values. | | ||
| <span class="prop-name">ValueLabelComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">ValueLabel</span> | The value label componnet. | | ||
| <span class="prop-name">valueLabelDisplay</span> | <span class="prop-type">enum: 'on' |<br> 'auto' |<br> 'off'<br></span> | <span class="prop-default">'off'</span> | Controls when the value label is displayed:<br>- `auto` the value label will display when the thumb is hovered or focused. - `on` will display persistently. - `off` will never display. | | ||
| <span class="prop-name">valueLabelFormat</span> | <span class="prop-type">union: string |<br> func<br></span> | <span class="prop-default">x => x</span> | The format function the value label's value.<br>When a function is provided, it should have the following signature:<br>- {number} value The value label's value to format - {number} index The value label's index to format | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature looks to be missing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's an issue with the markdown genetation tool.
There's no visual indication that the thumb is focused (i.e. no focus-visible) until a key is pressed after clicking on the rail. You can see this in Oliviers video. Basically clicking the rail should/did not focus the thumb. If that behavior is described in the W3C spec we should stick to it but make the focus-visible styling consistent. But so far this is a regression from previous behavior and wai-aria authoring practices. |
@eps1lon I more fully understand what you're getting at now, but it is still unclear to me whether there is a problem with the new behavior. There are two main questions to answer:
|
I support @ryancogswell points here. In the light of contradictions between different sources, I think that we should follow them in this order:
|
Co-Authored-By: Josh Wooding <12938082+joshwooding@users.noreply.github.com>
I propose that we discuss this in a separate issue. I would put the W3 spec above all the points listed above and move browser implementation to the bottom (again those have proven to be a bad reference for normalized behavior) but we can compare this at length later. |
Should we raise the problem in https://github.com/w3c/aria-practices/issues? |
This is one step further. We are not done yet! |
@oliviertassinari @eps1lon where did jumped pseudoselector go? |
@Astrantia This |
This is a work in progress: 97% (44 hours): https://deploy-preview-15703--material-ui.netlify.com/components/slider/.
onChange(event, value)
signature. It's not the first time we use it. It's also the one suggested in [RFC] onChange -> onInput, and don't polyfill onInput for uncontrolled components facebook/react#9657.data-
attribute for the problem. I don't think that the Slider should account for it.- Closes Popper can't update position when content height changed #15802 - Expose a popperRef prop.onChange
for consistency with the other components. We introduce anonAfterChange
prop for the case described:Then, we wait for facebook/react#9657 to migrate all our input components.