-
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: the dropdown arrow is not clickable on IE #397
Comments
The dropdown arrow is created in CSS: .d-combobox::after {
content: "\25BC";
pointer-events: none; /* allow clicks to pass through */
...
} (in https://github.com/ibm-js/deliteful/blob/master/Combobox/themes/Combobox_template.less). The trouble is that |
Additionally, the dropdown arrow should have a pointer cursor, not a text cursor.
|
Browsers behave differently in terms of cursor. For instance, Chrome/Win7 shows a pointer cursor by default on a It goes better with the pointer cursor set explicitely for |
OK, maybe it should be designed differently. When you will implement the keyboard navigation of a combobox like |
With the current design, the combo does get the key events, thus is able to forward them to the List, and, thanks to KeyNav.focusDescendants = false, navigating through list items will not give the focus to list items.
If you refer to the relative z order between arrow and input, the arrow pseudo-element is already in a layer on top of the input (you can see it thanks to the background color in this modified version: http://jsfiddle.net/adrian_vasiliu/07mwpgbm/). |
OK, some more remarks:
The cursor on the arrow is not correct because mouse is disabled by:
So maybe you can explicitly manage mouse events on the arrow and not rely on the pass through to have the correct cursor.
In tests/functional/Combobox-prog.html, I tried to select, only with the keyboard, a country in the second combobox. List items seem to be focused when iterating on items using ARROWS? For me it seems correct. |
Right, and moreover it seems I need anyway to not rely on the pass through because it doesn't work on IE. Now, this is a bit unfortunate, for 2 reasons:
Anyway, despite the drawbacks, if no better solution will show up, I'll go in this direction.
Since you previously wrote "when you will implement the keyboard navigation", I thought you already know the keyboard navigation is not yet implemented. This will come next (#362). Anyway, so this is why it doesn't work... |
One more thought, if you remove pointer-events, you have the correct cursor and you can still listen for click events on the d-combobox? Or maybe using pointer-events have another benefit I miss? |
Oh, that does the trick indeed! Thanks!
Well, that's something to ask for delite/HasDropDown, which is the one currently listening for pointer events for opening/closing the dropdown. But I guess a benefit is that it's an easy way to escape from the 300ms delay of click events. |
Hm, it does entirely the trick on Chrome and FF / Win7, but not on IE11/Win7... While the arrow does become clickable (which is great), the pointer cursor does not show up on the arrow on IE11 unless cursor: pointer is set on the input too, not only on the arrow. See http://jsfiddle.net/n10h8ogq/2/ . |
Too bad, it confirms my feeling that ::before and ::after pseudo classes are not consistent across browsers. It remains to try to use an actual DOM node for the arrow...or considering it's not worth it. |
Well, as said above (#397 (comment)), browsers are inconsistent already for the cursor of a readonly input element, without any ::before or ::after into the picture.
My preference would go towards keeping the pseudo-element for the arrow, while making a choice among a) enforcing pointer cursor for all inputs (including editable) and b) setting pointer cursor only on readonly inputs, thus not having pointer cursor on the arrow on IE. After all, a) might be not that bad, knowing that the pointer cursor is correctly conveying the information that you can click the input (not only the arrow), and once the dropdown opens you do get the text blinking caret as hint that you can type into it. |
Looks good enough and it won't break anything if you change the arrow implementation in the future. |
Pushed in 69b213e. Besides fixing the non-clickable dropdown arrow in IE, it also sets the pointer cursor in such a way that it works in all desktop browsers. |
And thanks @dmandrioli for your useful suggestions. |
…and to consistently get pointer cursor on all desktop browsers.
…#397) and to consistently get pointer cursor on all desktop browsers.
On IE 10 and 11, to open the dropdown the user cannot click on the dropdown arrow; however, clicking the combo element outside the arrow does open the dropdown.
Originally reported by @mythic2 in #382.
The text was updated successfully, but these errors were encountered: