Skip to content
New issue

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

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

Already on GitHub? # to your account

[PLAY-91] Add unique key prop to text input #1741

Merged
merged 4 commits into from
Feb 15, 2022

Conversation

kyleschechter
Copy link
Contributor

@kyleschechter kyleschechter commented Jan 24, 2022

Screens

image

Breaking Changes

No. A unique key prop was added to the actual input element of the Text Input kit, clearing the error message that usually persists in the console when working with this kit in React.

Runway Ticket URL

https://nitro.powerhrg.com/runway/backlog_items/PLAY-91

How to test this

  1. Navigate to http://localhost:3000/kits/text_input/react
  2. Open console log
  3. Check to make sure error is not there anymore

Checklist:

  • LABELS Add a label: enhancement, bug, improvement, new kit, deprecated, or breaking. See Changelog & Labels for details.
  • DEPLOY Please add the Milano label when you are ready for a review.
  • SCREENSHOT Please add a screen shot or two.
  • SPECS Please cover your changes with specs.
  • READ DOCS Please make sure you have read and understand the Playbook Release Process

@kyleschechter kyleschechter requested a review from a team as a code owner January 24, 2022 20:55
@kyleschechter kyleschechter self-assigned this Jan 24, 2022
@kyleschechter kyleschechter added enhancement New Features, Props, & Variants (USED IN CHANGELOG) milano 20 MAX - Deploy this PR to a review environment via Milano labels Jan 24, 2022
@app-milano app-milano bot temporarily deployed to pr1741 January 24, 2022 21:18 Inactive
@thestephenmarshall thestephenmarshall force-pushed the Play-91-Unique-key-props-text-input branch from ba96cd5 to 39d7c75 Compare January 27, 2022 20:16
@app-milano app-milano bot temporarily deployed to pr1741 January 27, 2022 20:33 Inactive
Copy link
Contributor

@thestephenmarshall thestephenmarshall left a comment

Choose a reason for hiding this comment

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

After thinking about this more, if there is not a default then the key will always be the _className prop string which will not be unique.

@kyleschechter
Copy link
Contributor Author

@thestephenmarshall Is there ever going to be a scenario where there isn't an 'id'? I just figured there would always be one. If not though, I can look into a function or something to generate unique id's.

@thestephenmarshall
Copy link
Contributor

@kyleschechter of course there could be. Here you have an optional prop which means it can be undefined. And here you have no default value.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New Features, Props, & Variants (USED IN CHANGELOG) milano 20 MAX - Deploy this PR to a review environment via Milano
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants