Skip to content

fix(hotkeys): recognize contenteditable="plaintext-only" in isInputElement#51

Merged
KevinVandy merged 1 commit intoTanStack:mainfrom
magicismight:fix/is-input-element-plaintext-only
Mar 6, 2026
Merged

fix(hotkeys): recognize contenteditable="plaintext-only" in isInputElement#51
KevinVandy merged 1 commit intoTanStack:mainfrom
magicismight:fix/is-input-element-plaintext-only

Conversation

@magicismight
Copy link
Contributor

Closes #50

Summary

isInputElement() previously checked element.contentEditable against 'true' and '', missing 'plaintext-only' and inherited contenteditable. This caused hotkeys with ignoreInputs: true (the default for single keys like Backspace/Delete) to fire while typing in contenteditable="plaintext-only" elements.

Replaced the string comparison with element.isContentEditable, a computed boolean that covers all editable states:

  • contenteditable="true"
  • contenteditable=""
  • contenteditable="plaintext-only"
  • Inherited contenteditable from ancestor elements

Test plan

  • Added test: contenteditable="plaintext-only" element is recognized as input
  • Added test: child element inheriting contenteditable from parent is recognized as input
  • All 277 existing tests pass

Made with Cursor

Use element.isContentEditable instead of checking contentEditable string
values. This covers plaintext-only and inherited contenteditable, which
were previously missed causing hotkeys to fire in editable elements.

Closes TanStack#50

Made-with: Cursor
@KevinVandy KevinVandy merged commit 67decce into TanStack:main Mar 6, 2026
2 of 3 checks passed
@github-actions github-actions bot mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isInputElement does not recognize contenteditable="plaintext-only"

2 participants