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

Misc updates for v6 #620

Merged
merged 13 commits into from
Jun 26, 2020
Merged

Misc updates for v6 #620

merged 13 commits into from
Jun 26, 2020

Conversation

vladucu
Copy link
Member

@vladucu vladucu commented Jun 26, 2020

  • adds few files missed for text-field component during modernization PR
  • deprecates passing @tagName to some components and replaces it with htmlTag
  • some cleanup: no .get where it's not needed
  • fixes the version for new deprecations added - this will be v6 so we'll support those through to v7
  • [Breaking] removes long deprecated labelComponent for choice component

Copy link
Member

@andrewpye andrewpye left a comment

Choose a reason for hiding this comment

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

Big ol' PR to trawl through, I've left some comments on a couple of things I noticed. I think we need to test PolarisTextField carefully around events (focus/blur etc.), and multiline (re)sizing etc. based on what I've seen in the code. Didn't pay a huge amount of attention to the test file updates, they're just compacting some multi-line things down to single line and changing to angle bracket notation right?

Comment on lines 18 to 31
<div
class="Polaris-TextField__DummyInput"
{{did-insert this.this.setContentNode}}
>
{{this.finalContents}}
</div>

{{#if @minimumLines}}
<div
class="Polaris-TextField__DummyInput"
{{did-insert this.setMinimumLinesNode}}
>
{{this.contentsForMinimumLines}}
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked that multiline text fields render/resize to fit their content correctly with these changes? There's a comment at the top of this file that says these two dummy inputs need to be on a single line to render the correct size. If that's no longer the case, can we remove the comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

checked now, fixed some issues 🙌

>
<div
class="Polaris-TextField__DummyInput"
{{did-insert this.this.setContentNode}}
Copy link
Member

Choose a reason for hiding this comment

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

Extra this. in here 😬

Suggested change
{{did-insert this.this.setContentNode}}
{{did-insert this.setContentNode}}

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch!

@@ -1,4 +1,4 @@
{{#let (element (or @htmlTag "p")) as |DisplayText|}}
{{#let (element (or (or @htmlTag @tagName) "p")) as |DisplayText|}}
Copy link
Member

Choose a reason for hiding this comment

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

Can just be

Suggested change
{{#let (element (or (or @htmlTag @tagName) "p")) as |DisplayText|}}
{{#let (element (or @htmlTag @tagName "p")) as |DisplayText|}}

instead of nesting ors? Same applies in a few other places where you've added htmlTag support.

spellcheck={{@spellCheck}}
value={{this.normalizedValue}}
class={{this.inputClassName}}
aria-multiline={{@multiline}}
Copy link
Member

Choose a reason for hiding this comment

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

Does this add aria-multiline="false" or anything similar if @multiline={{true}} is passed to the PolarisTextField? If so, can we check if that replicates the React implementation and if not, update it? 🙇

Copy link
Member Author

Choose a reason for hiding this comment

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

made sure it matches react implementation

Copy link
Member Author

@vladucu vladucu left a comment

Choose a reason for hiding this comment

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

Updated, nice catches

>
<div
class="Polaris-TextField__DummyInput"
{{did-insert this.this.setContentNode}}
Copy link
Member Author

Choose a reason for hiding this comment

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

good catch!

Comment on lines 18 to 31
<div
class="Polaris-TextField__DummyInput"
{{did-insert this.this.setContentNode}}
>
{{this.finalContents}}
</div>

{{#if @minimumLines}}
<div
class="Polaris-TextField__DummyInput"
{{did-insert this.setMinimumLinesNode}}
>
{{this.contentsForMinimumLines}}
</div>
Copy link
Member Author

Choose a reason for hiding this comment

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

checked now, fixed some issues 🙌

spellcheck={{@spellCheck}}
value={{this.normalizedValue}}
class={{this.inputClassName}}
aria-multiline={{@multiline}}
Copy link
Member Author

Choose a reason for hiding this comment

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

made sure it matches react implementation

@vladucu vladucu requested a review from andrewpye June 26, 2020 13:23
Copy link
Member

@andrewpye andrewpye left a comment

Choose a reason for hiding this comment

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

Nice one @vladucu, thanks for this! 🙌

@vladucu vladucu merged commit e220ae5 into v6 Jun 26, 2020
@vladucu vladucu deleted the misc-updates branch June 26, 2020 13:42
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.

None yet

2 participants