Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(text-field): create a custom spinner for number inputs #299

Closed
wants to merge 2 commits into from

Conversation

samrichardsontylertech
Copy link
Contributor

@samrichardsontylertech samrichardsontylertech commented May 6, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added/updated: N
  • Docs have been added/updated: N
  • Does this PR introduce a breaking change? N
  • I have linked any related GitHub issues to be closed when this PR is merged? N/A

Describe the new behavior?

Created a new Spinner component to replace the native spinner in <input type="number" /> elements. The native version is misaligned with the Text Field component and inconsistent between browsers.

Additional information

This is currently intended only for use within the library. Because input fields already expose controls for accessibility the Spinner component is essentially hidden from the accessibility tree and keyboard interaction.

The major hurdle in adding this to the Text Field component is going to be hiding the native spinner. This can be done by targeting input[type="number"]::-webkit-inner-spin-button (or using -moz-appearance: textfield in Firefox) but because this involves a pseudo-element it doesn't seems to be feasible from the shadow DOM.

@stackblitz
Copy link

stackblitz bot commented May 6, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions bot added the minor Increment the minor version when merged label May 6, 2023
@DRiFTy17 DRiFTy17 added the skip-release Preserve the current version when merged label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged skip-release Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants