Skip to content

fix: TokenField bugs - #10505

Open
devongovett wants to merge 5 commits into
mainfrom
tokenfield-bugs
Open

fix: TokenField bugs#10505
devongovett wants to merge 5 commits into
mainfrom
tokenfield-bugs

Conversation

@devongovett

Copy link
Copy Markdown
Member
  • Fixes a crash that occurred occasionally when selecting tokens. Reproduction: Go to PromptField "Everything", autofill with Detect audiences in..., delete everything after Journey. Tap journey and replace it with Re-engagement. Then tap the word "Campaign" to replace it again. It will error with "The index is not in the allowed range".
  • Fixes styles of tokens that wrap across multiple lines in PromptField using box-decoration-break: clone
  • Adds an onClick handler to tokens to select them when tapping with a touch screen reader.
  • Fixes blue browser text selection rectangle rendering on the edge of a token in Safari. This was due to the selection containing the hidden zero width spaces. We now apply the ::selection style to the token wrapper element using an injected stylesheet in RAC. Not sure if too opinionated, but also not sure why you'd want the default text selection when there is a custom selection style for tokens.

// its leading newline. Windows/Linux have no such shortcut: Ctrl+Backspace deletes the
// previous word ("world"), leaving the newline behind.
await waitForFieldText(getValue, isMacPlatform() ? 'hello' : 'hello\n');
await waitForFieldText(getValue, 'hello\n');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IME fix #10422 broke this test on macOS. getTargetRanges includes a range when deleting to the beginning of the line that does not include the newline. Now that we are using that range instead of computing it ourselves, we get this difference.

@rspbot

rspbot commented Aug 24, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Aug 24, 2026

Copy link
Copy Markdown
## API Changes

react-aria-components

/react-aria-components:setInteractionModality

-setInteractionModality {
-  modality: Modality
-  returnVal: undefined
-}

/react-aria-components:Modality

-Modality {
-  M: undefined
-}

@rspbot

rspbot commented Aug 24, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (10)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/a5694587520c889ee82c8e182208d3dafeb29762/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/a5694587520c889ee82c8e182208d3dafeb29762/

@devongovett
devongovett marked this pull request as ready for review August 24, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants