-
Notifications
You must be signed in to change notification settings - Fork 36
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
Combobox: multiple fixes. #674
Changes from 1 commit
b4e53a5
b0199b3
ff26def
23c5824
80e6270
3f36ca1
50a0edf
95a0fb2
4d46111
49fabb6
1ff8cb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<template role="presentation" | ||
requires="deliteful/LinearLayout, deliteful/Button"> | ||
<d-linear-layout style="height: 100%"> | ||
<div class="d-combo-popup-header">{{header}}</div> | ||
<div class="d-combo-popup-header" id="{{_tag}}-{{widgetId}}-header">{{header}}</div> | ||
<input d-hidden="{{this.combobox._inputReadOnly}}" | ||
aria-labelledby="{{_tag}}-{{widgetId}}-header" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filed #686. |
||
attach-point="inputNode" | ||
class="d-combobox-input" | ||
role="combobox" autocomplete="off" autocapitalize="none" autocorrect="off" | ||
|
@@ -17,4 +18,4 @@ | |
label="{{combobox.okMsg}}" on-click="{{okHandler}}"></button> | ||
</d-linear-layout> | ||
</d-linear-layout> | ||
</template> | ||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,11 @@ define([ | |
.removeClass("d-hidden"); | ||
} | ||
this.combobox._prepareInput(this.inputNode); | ||
this.combobox.observe(function (oldValues) { | ||
if ("opened" in oldValues) { | ||
this.inputNode.setAttribute("aria-expanded", this.combobox.opened); | ||
} | ||
}.bind(this)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused, isn't this.combobox.opened always true whenever ComboPopup is shown? Also (minor thing), the checkin comment since aria-described but the code change is for aria-labelledby. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Usually the list is displayed, but sometimes it isn't, like the second to last test case in ComboPopup.html where hasDownArrow=false minFilterChars=3. The list is only displayed after typing 3 characters. PS: Perhaps ComboPopup should have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filed #687. |
||
} | ||
} | ||
}, | ||
|
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.
Note: This confused me at first since tests/functional/ComboPopup.js already checks for a label for the input:
It turns out that test is useless though because it's checking the
<label>
for the<input>
in the original Combobox rather than for the<input>
in the ComboPopup.So, I see why you added this. It's unusual to use aria-labelledby rather than
<label>
though.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.
PS: Oh, I just realized that it isn't checking the
<label>
for the<input>
in the original Combobox but rather just getting the value, to be used later.