fix(select): add Enter keypress to dismiss#30622
fix(select): add Enter keypress to dismiss#30622haryopba wants to merge 3 commits intoionic-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Thank you for the fix and tests! It looks like this doesn't work to select the value using Enter and there is also an issue where the modal immediately closes when you use Enter to open it after selecting something:
modal.mov
This also happens on the Popover example.
I think we need to add something like this to onKeyDown in radio-group to capture the value:
// Handle Enter key for select interfaces
if (['Enter'].includes(ev.key) && inSelectInterface) {
const previousValue = this.value;
this.value = current.value;
if (previousValue !== this.value) {
this.emitValueChange(ev);
}
ev.preventDefault();
}But I'm not sure how to fix the other problem right now.
|
@brandyscarney, sorry for the late response. The immediate close happens because the modal opens on keydown with |
|
@haryopba Thank you for taking another look! I considered using holding-enter.movI think we'll need to find another solution. 🤔 |
Issue number: resolves #30561
What is the current behavior?
Pressing
Enterdoes not dismiss modal or popover inselect-modalorselect-popoverWhat is the new behavior?
Enterdismisses modal or popover inselect-modalorselect-popoverDoes this introduce a breaking change?
Other information
N/A