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

Update "Textfield" to most recent Spectrum CSS beta #543

Closed
Westbrook opened this issue Mar 16, 2020 · 0 comments · Fixed by #790
Closed

Update "Textfield" to most recent Spectrum CSS beta #543

Westbrook opened this issue Mar 16, 2020 · 0 comments · Fixed by #790

Comments

@Westbrook
Copy link
Contributor

Westbrook commented Mar 16, 2020

Expected Behaviour

Textfield meets the most recent Spectrum CSS specification

Actual Behaviour

Beta releases of this pattern have breaking changes.

block #477

Proposal

Re-implement this pattern with @spectrum-css/[email protected].

Considerations:

  • The beta releases rely on [dir="rtl"] selectors, the CSS for which needs to be processed differently than previously. This also requires some affordance in the JS to acquire dir from an ancestor element. The easiest approach here would be to leverage document.dir but it's technically possible to have multiple dir values across a document. Should we resolve this value to the "closest" instance or to the "root" instance? Either seems acceptable if we document it and allow it to be locally set.
  • order of selector writing can cause processing errors where [dir=ltr] .spectrum-Textfield--quiet.spectrum-Textfield.is-invalid .spectrum-Textfield-validationIcon becomes :host([quiet][invalid]) .spectrum-Textfield[dir='ltr'] .icon due to expectations in our processing
  • uses .is-focused and .is-keyboard focused as opposed to :focus and :focus-visible so we'll need to manage those values (possibly not that big of a deal being these selectors ALWAYS duplicate an input:focus selector that matches it for appropriately to our current approach)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant