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

refactor(dropdown, dropdown-item-group, dropdown-item): getElementProp is refactored out in favor of inheritable props set directly on parent #7582

Merged

Conversation

Elijbet
Copy link
Contributor

@Elijbet Elijbet commented Aug 23, 2023

Related Issue: #6038

Summary

getElementProp is refactored out across child components as an outdated pattern in favor of inheritable props set directly on the parent.

The logic for setting these props thus moves to the parent, getting rid of the getElementProp altogether. The parent component gets a mutationObserver to do this as well as watchers for when it needs to modify the children.

Inherited props addressed:

  • scale is inherited from dropdown,
  • selectionMode is inherited from dropdown-item-group, so there can be a mix of types within one dropdown.

…p is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent
@Elijbet Elijbet added the refactor Issues tied to code that needs to be significantly reworked. label Aug 23, 2023
@Elijbet Elijbet marked this pull request as ready for review August 24, 2023 01:13
@Elijbet Elijbet requested a review from a team as a code owner August 24, 2023 01:14
@Elijbet Elijbet added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Aug 24, 2023
@Elijbet Elijbet added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Aug 24, 2023
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

💯 🎈 👍

@Elijbet Elijbet changed the title refactor(dropdown, dropdown-item-group, dropdown-item): getElementProp is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent refactor(dropdown, dropdown-item-group, dropdown-item): getElementProp is refactored out in favor of inheritable props set directly on parent Aug 24, 2023
@Elijbet Elijbet added skip visual snapshots Pull requests that do not need visual regression testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Aug 24, 2023
@Elijbet Elijbet merged commit b5fa7f4 into main Aug 24, 2023
@Elijbet Elijbet deleted the origin/elijbet/6038-refactor-getElementProp-dropdown-item branch August 24, 2023 19:29
@github-actions github-actions bot added this to the 2023 August Priorities milestone Aug 24, 2023
benelan added a commit that referenced this pull request Aug 25, 2023
…input

* origin/main:
  refactor(segmented-control, segmented-control-item): `getElementProp` is refactored out in favor of inheritable props set directly on parent (#7592)
  chore: release next
  fix(loader): tweak loading animations to work in Safari (#7564)
  refactor(dropdown, dropdown-item-group, dropdown-item): `getElementProp` is refactored out in favor of inheritable props set directly on parent (#7582)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues tied to code that needs to be significantly reworked. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants