Skip to content

Commit

Permalink
fix(useShortcuts): include contenteditable="plaintext-only" element…
Browse files Browse the repository at this point in the history
…s in `usingInput` (#1159)
  • Loading branch information
slugcat-dev authored Dec 25, 2023
1 parent d0ce8ee commit 648eec3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/composables/useShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export const _useShortcuts = () => {

const activeElement = useActiveElement()
const usingInput = computed(() => {
const usingInput = !!(activeElement.value?.tagName === 'INPUT' || activeElement.value?.tagName === 'TEXTAREA' || activeElement.value?.contentEditable === 'true')
const contentEditable = activeElement.value?.contentEditable

return !!(activeElement.value?.tagName === 'INPUT' || activeElement.value?.tagName === 'TEXTAREA' || contentEditable === 'true' || contentEditable === 'plaintext-only')

if (usingInput) {

Check failure on line 16 in src/runtime/composables/useShortcuts.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Must use `.value` to read or write the value wrapped by `computed()`
return ((activeElement.value as any)?.name as string) || true
Expand Down

0 comments on commit 648eec3

Please sign in to comment.