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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RangeSlider] Fix range slider focus state #1926
Conversation
馃憢 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven鈥檛 already, please check out the contributing guidelines. You can also join #polaris on the Shopify Partners Slack. |
Hey @spencercanner, sorry for the delay on getting review on this PR, seems like it must have fallen between the cracks. I've tophatted this change, and it's looking great in the single input range slider. I'd love to see this change made in the dual input range slider as well. The focus state in it currently is pretty gross.
Also pinging @dpersing for her thoughts on the high contrast styles. I wonder if the |
@danrosenthal @spencercanner Hi! Thanks so much for catching this. I think we want to maintain a focus state for High Contrast that doesn't rely on color alone, since it's a subtle change. Having a focus indicator on the full input would be ideal, since this mimics the default focus ring behavior. What tool and browser are you using for the high contrast setting in this case? I ask since we typically test with Edge and the native High Contrast theme settings on Windows, which looks like this for the current example in the style guide: Default: Focus state: |
@dpersing I was testing with Edge as well, but running it on a VirtualBox Windows VM using the |
@spencercanner Gotcha, that is curious. I had the same theme, but I'm using VMware and looking at the version that's currently in the style guide. I'll block out some time later today to take a closer look. |
73e38cd
to
48d9584
Compare
馃挦 Potential splash zone of changes introduced to
DetailsAll files potentially affected (total: 3)馃搫
|
@danrosenthal I've updated the PR to include the single and dual thumb range slider focus states, and added more detail in the PR description above @dpersing I think the HC inconsistencies were caused by my VM running an older version of Edge, but I've updated the PR to include HC focus styling for both the single and dual thumb range sliders |
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.
Hey @spencercanner, sorry this one fell between the couch cushions. I'm happy for this to merge as-is once it's gotten a rebase. @dpersing any objections?
@spencercanner, I'm going to go ahead and rebase, fix the conflict, and merge this PR. |
48d9584
to
fb92e5b
Compare
馃帀 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
WHAT is this pull request doing?
SingleThumb
styles which was preventing the focus styles from being applied to the input.RangeSlider
selector was never used anywhere in the component, and was left over from the before theDualThumb
component existedSingleThumb
input when focused in high contrast modeSingleThumb
styles to prevent focus from taking over the error track colourDualThumb
scss to apply consistent focus styles across both componentsDualThumb
thumb button when focused in high contrast modeDualThumb
buttons to prevent them from receiving focus when the component is disabledHow to 馃帺
馃枼 Local development instructions
馃棐 General tophatting guidelines
馃搫 Changelog guidelines
General case:
Error state:
error="error"
as a propCopy-paste this code in
playground/Playground.tsx
:Mac Chrome:
Single without focus:
Single with focus:
Single error without focus:
Single error with focus:
Double without focus:
Double with focus:
Double error without focus:
Double error with focus:
Edge:
Single without focus:
Single with focus:
Single error without focus:
Single error with focus:
Double without focus:
Double with focus:
Double error without focus:
Double error with focus:
High contrast mode:
Single without focus:
Single with focus:
Single error without focus:
Single error with focus:
Double without focus:
Double with focus:
Double error without focus:
Double error with focus:
馃帺 checklist
README.md
with documentation changes