-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Replace on:change with on:blur #5861
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
Conversation
Now that I've read through the previous PR, I think I'm 👎 on this change as it currently is. I think a better way to handle this would be for the docs to discuss the difference between on:change and on:blur, the accessibility implications of both (especially for keyboard-only users, who will be firing on:change repeatedly as they scroll through the list of options) and what you need to think about when using on:change. I.e., just make sure the on:change handler doesn't do anything major like browsing to another page or deleting a record; as long as the on:change handler will cause no problems if fired repeatedly for every option on the list, then you're fine from an a11y standpoint. Now, that might be a bit much to squeeze into the tutorial. But a paragraph or two in the API docs would be a good idea, and then we can insert one sentence into the tutorial that says "Click here to read more" and links to that section of the API docs. But I don't want to recommend on:blur instead of on:change as the default interaction mode for I also think that #4946 (comment) is important enough that I'm just going to copy it straight over here:
The most important point, IMHO, is the third one. Most people would easily figure out points 1 and 2, but point 3 wouldn't occur to most non-impaired developers unless they were told about it, or unless they tried out screen-reader software for themselves. So I think it's worth mentioning that point somehow in the API docs section that discusses the a11y implications of on:change vs on:blur. |
Oh, and here's another reason for me to give a 👎 vote to this PR: that a11y warning is deprecated now in |
I don't know what to do about this, but I hope my "new Svelte learner" thoughts are helpful:
Thank you for a great tutorial! |
#5967 is related because it appears similarly in this later tutorial step: https://svelte.dev/tutorial/sharing-code |
@burgerreto2020 click unsubscribe in the right hand column. |
Thanks for taking a look at fixing the warning. The warning was recently removed (#6457), so I believe this can be left as is |
Addresses the A11y warning on the tutorial module Block 6 Lesson 6:
A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users. (24:1)
It appears that this PR has been attempted before but declined due to the change creating some conflicts when using a mouse vs. the keyboard. However, the PR(s?) are several months old and as far as I can tell the change from
on:change
toon:blur
no longer has any negative effects. Perhaps this is because of browser updates... I checked several browsers and did not notice any of the previously noticed ill effects (I was checking on a Mac... Can anyone verify on IE? If needed I could spin up an AWS Windows VM).Link to discussion here, here and the previous PR here.
Tagging previous authors to offer input, if any - @gsimone & @pablote
Tests
npm test
returns errors related to WebSocket...Error: WebSocket is not open: readyState 3 (CLOSED)
I am pretty sure my changes are not causing that. Likely my environment (?).3194 passed, 24 pending, 8 failing...
npm run lint
checks out okay.