You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It apparently triggers this code in Checkbox.js, so that clicking the <label> focuses the <d-checkbox>:
// The fact that deliteful/Checkbox is not an HTMLInputElement seems not being compatible with the default// "<label for" behavior of the browser. So it needs to explicitly listen to click on associated// <label for=...> elements.if(!labelClickHandler){// set a global listener that listens to click events on label eltlabelClickHandler=function(e){varforId;if(/label/i.test(e.target.tagName)&&(forId=e.target.getAttribute("for"))){varelt=document.getElementById(forId);if(elt&&elt.render&&elt._lbl4!==undefined){//_lbl4: to check it's a checkbox// call click() on the input instead of this.toggle() to get the 'change' event for freeelt.focusNode.click();}}};this.ownerDocument.addEventListener("click",labelClickHandler);}
The issues are:
Why is this code only for checkbox? What about <d-combobox> etc.? Probably the code should be in delite as a service to be used by various deliteful widgets.
I don't see any tests for Combobox labels.
The test for tagName === "label" should check the regex /^label$/i not /label/i.
While the <label> syntax is easier to read and more familiar to developers, it doesn't work for Safari VoiceOver (iOS 8.1), and it isn't technically correct, according to the ARIA spec. I didn't try iOS 8.3 though.
The text was updated successfully, but these errors were encountered:
Checkbox apparently has support for the following syntax for labelling:
It apparently triggers this code in Checkbox.js, so that clicking the
<label>
focuses the<d-checkbox>
:The issues are:
<d-combobox>
etc.? Probably the code should be in delite as a service to be used by various deliteful widgets./^label$/i
not/label/i
.While the
<label>
syntax is easier to read and more familiar to developers, it doesn't work for Safari VoiceOver (iOS 8.1), and it isn't technically correct, according to the ARIA spec. I didn't try iOS 8.3 though.The text was updated successfully, but these errors were encountered: