HTML5-placeholder-polyfill icon indicating copy to clipboard operation
HTML5-placeholder-polyfill copied to clipboard

remove node instead of hiding when a11y is turned off

Open ginader opened this issue 12 years ago • 2 comments

good comment by Alexander Farkas mentions that Internet Explorer will send the whole content of a label to the Accessibility API no matter if it's display:none or not. To work around that issue let's remove the placeholder node (plus force refresh the virtual buffer) in the label on focus to avoid it being read when visibleToScreenreaders is set to false

ginader avatar Apr 13 '12 22:04 ginader

I'm not sure wether this will work correctly. As you may already noticed from your prior tests with screenreaders changing the name or a property of an element right in the case, the user is interacting with the element, can lead to the result, that the old and the new "value" is read to the screenreader. The best way (most secure, no need to test with screenreader) to workaround this, is to place the placeholder-text outside of the label.

And you really don't need to force a refresh, the user is already interacting with a form element and not a "normal" node (=virtual buffer is likley up-to-date).

aFarkas avatar Apr 14 '12 11:04 aFarkas

Yeah I guess there's no reason to put it into the label in the first place when visibleToScreenreaders is set to false so I will only do that when it's set to true and place it outside otherwise. Thanks Alexander :-)

ginader avatar Apr 14 '12 17:04 ginader