kopia lustrzana https://github.com/shoelace-style/shoelace
Fix bug where pressing enter on a tag would open the control
rodzic
40976e58fa
commit
79b84cc47e
|
|
@ -150,8 +150,10 @@ export class Select {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyDown(event: KeyboardEvent) {
|
handleKeyDown(event: KeyboardEvent) {
|
||||||
// Open the dropdown when enter is pressed
|
const target = event.target as HTMLElement;
|
||||||
if (!this.isOpen && event.key === 'Enter') {
|
|
||||||
|
// Open the dropdown when enter is pressed while the input is focused
|
||||||
|
if (!this.isOpen && event.key === 'Enter' && target === this.input) {
|
||||||
this.dropdown.show();
|
this.dropdown.show();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue