Skip to content

Commit

Permalink
fix(core): fix web components compatibility in KeyboardDriver (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
febugcoder committed Feb 9, 2022
1 parent 432a89f commit ba7dc10
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/drivers/KeyboardDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ function filter(event: KeyboardEvent) {
const target: any = event.target
const { tagName } = target
let flag = true
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>
// ignore: isContentEditable === 'true', <input> and <textarea> when readOnly state is false, <select>、Web Components
if (
target['isContentEditable'] ||
((tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT') &&
((tagName === 'INPUT' ||
tagName === 'TEXTAREA' ||
tagName === 'SELECT' ||
customElements.get(tagName.toLocaleLowerCase())) &&
!target.readOnly)
) {
flag = false
Expand Down

0 comments on commit ba7dc10

Please sign in to comment.