File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -94,12 +94,20 @@ export class SelectModal implements ComponentInterface {
9494 justify = "start"
9595 labelPlacement = "end"
9696 onClick = { ( ) => this . closeModal ( ) }
97+ onKeyDown = { ( ev ) => {
98+ if ( ev . key === 'Enter' ) {
99+ /**
100+ * Selecting a radio option with keyboard navigation,
101+ * Enter key should dismiss the modal.
102+ */
103+ this . closeModal ( ) ;
104+ }
105+ } }
97106 onKeyUp = { ( ev ) => {
98- if ( ev . key === 'Enter' || ev . key === ' ') {
107+ if ( ev . key === ' ' ) {
99108 /**
100109 * Selecting a radio option with keyboard navigation,
101- * either through the Enter or Space keys, should
102- * dismiss the modal.
110+ * Space key should dismiss the modal.
103111 */
104112 this . closeModal ( ) ;
105113 }
Original file line number Diff line number Diff line change @@ -159,12 +159,20 @@ export class SelectPopover implements ComponentInterface {
159159 value = { option . value }
160160 disabled = { option . disabled }
161161 onClick = { ( ) => this . dismissParentPopover ( ) }
162+ onKeyDown = { ( ev ) => {
163+ if ( ev . key === 'Enter' ) {
164+ /**
165+ * Selecting a radio option with keyboard navigation,
166+ * Enter key should dismiss the popover.
167+ */
168+ this . dismissParentPopover ( ) ;
169+ }
170+ } }
162171 onKeyUp = { ( ev ) => {
163- if ( ev . key === 'Enter' || ev . key === ' ') {
172+ if ( ev . key === ' ' ) {
164173 /**
165174 * Selecting a radio option with keyboard navigation,
166- * either through the Enter or Space keys, should
167- * dismiss the popover.
175+ * Space key should dismiss the popover.
168176 */
169177 this . dismissParentPopover ( ) ;
170178 }
You can’t perform that action at this time.
0 commit comments