Skip to content

Conversation

reidbarber
Copy link
Member

@reidbarber reidbarber commented Jun 10, 2021

Closes #1877

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

For components that use useFormattedTextField (i.e. NumberField and ColorField):

  1. Type text into input
  2. Press CMD + Delete
  3. Verify input is empty and remains active

🧢 Your Project:

@reidbarber reidbarber added the small review Easy to review PR label Jun 10, 2021
@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Thanks for adding these to our tests! Some manual testing notes:
Tested an old build

I don't think this is working correctly in Safari? I can't see CMD + Delete doing anything.

I think it's also not intended to be able to delete partial currency symbols, see https://reactspectrum.blob.core.windows.net/reactspectrum/50233b6d2f4b110c70f7a2badd5b76e61b1d76bc/storybook/index.html?path=/story/numberfield--currency-switcher
Set the Currency Display to Code, place the cursor in between two of the currency symbol letters, press Delete, nothing happens. Press CMD + Delete, it deletes a portion of the code.

What does state.validate return? That's the check to see if we should block the event and I'm surprised it's not blocking it while your test indicates it is.
https://github.com/adobe/react-spectrum/pull/2005/files#diff-0d27e9828095cc31dbe37a372f0dfc33464dfa4c1dd426d7952a3a6e8df28e25R99

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Tested across Chrome/FF/Safari, lgtm

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM

@reidbarber reidbarber merged commit 7a93da4 into main Jun 21, 2021
@reidbarber reidbarber deleted the Issue-1877 branch June 21, 2021 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small review Easy to review PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command + Delete doesn't delete NumberField input value
4 participants