Skip to content

Add Backspace and Delete editing for text inputs - #130

Open
cowboyd wants to merge 1 commit into
dom-input-editingfrom
dom-input-deletion
Open

cowboyd wants to merge 1 commit into
dom-input-editingfrom
dom-input-deletion

Conversation

@cowboyd

@cowboyd cowboyd commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

This PR is part of of the "Input Stack" which adds the following capabilities to the DOM

  • Focus management: focus(), blur(), activeElement, focus events, and cleanup when focused nodes are removed.
  • Focus navigation: Tab/Shift+Tab, tabindex ordering, wrapping, and disabled/inert filtering.
  • Focus styling: :focus, :focus-within, and :focus-visible under our keyboard-only policy.
  • Input editing: typing, replacing selections, Backspace/Delete, and cancelable beforeinput followed by input.
  • Caret movement: Left/Right across grapheme boundaries; Up/Down to the beginning/end of single-line inputs.
  • Shift-selection: extend, shrink, and reverse a selection while preserving its anchor. Readonly inputs allow movement and selection.
  • Input state APIs: value, selection endpoints/direction, setSelectionRange(), and setRangeText().

What does this PR do?

Adds Backspace and Delete for selections and adjacent graphemes, using the existing beforeinput/input editing flow. Supports query substitution in WPT helpers used by the deletion fixtures.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@cowboyd
cowboyd force-pushed the dom-input-deletion branch from b83b083 to aeefd4d Compare December 1, 2026 18:08
@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

commit: f7eea3a

@cowboyd
cowboyd force-pushed the dom-input-deletion branch from aeefd4d to 453ced5 Compare December 1, 2026 18:17
@cowboyd
cowboyd added this pull request to stack #114 December 1, 2026 18:53
@cowboyd
cowboyd force-pushed the dom-input-deletion branch from 453ced5 to acf1121 Compare December 1, 2026 18:58
@cowboyd
cowboyd force-pushed the dom-input-deletion branch from acf1121 to f7eea3a Compare December 1, 2026 19:40
@cowboyd
cowboyd marked this pull request as ready for review December 1, 2026 19:55
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.

1 participant