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(combobox, combobox-item, combobox-group): getElementProp is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent #7562

Merged
merged 9 commits into from
Aug 23, 2023

Conversation

Elijbet
Copy link
Contributor

@Elijbet Elijbet commented Aug 22, 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.

Instead of the combobox-item and combobox-group looking up the parent for scale, these get set by the combobox parent.

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

Inherited props addressed:

  • scale
  • selectionMode

…refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent
@github-actions github-actions bot added the refactor Issues tied to code that needs to be significantly reworked. label Aug 22, 2023
@Elijbet Elijbet changed the title refactor(combobox, combobox-item, combobox-group): getElementProp is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent refactor(combobox, combobox-item, combobox-group): getElementProp is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent Aug 22, 2023
@Elijbet Elijbet marked this pull request as ready for review August 22, 2023 18:37
@Elijbet Elijbet requested a review from a team as a code owner August 22, 2023 18:37
@Elijbet Elijbet added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Aug 22, 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.

Awesome. 👏 LGTM!

@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 22, 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 22, 2023
Copy link
Member

@benelan benelan left a comment

Choose a reason for hiding this comment

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

LGTM!

@Elijbet Elijbet merged commit f8a1b91 into main Aug 23, 2023
@Elijbet Elijbet deleted the elijbet/6038-refactor-getElementProp-combobox-item branch August 23, 2023 04:12
@github-actions github-actions bot added this to the 2023 August Priorities milestone Aug 23, 2023
benelan added a commit that referenced this pull request Aug 24, 2023
…input

* origin/main: (29 commits)
  chore: release next
  refactor(combobox-item): drop unused variable (#7587)
  fix(combobox): update combobox height to follow design spec (#7558)
  fix(split-button): update divider and borders to follow design spec (#7568)
  fix(segmented-control): refresh items when added dynamically (#7567)
  chore: release next
  feat(action-bar, action-pad, action-group): Add label properties for group context (#7415)
  test(modal, shell): add delay to recent unstable stories (#7589)
  chore: release next
  fix(modal): handle removal of open attribute and prevent multiple beforeClose calls (#7470)
  fix(tree-item): move focus outline to item label area (#7581)
  chore: add explainers to disabled jsx-sort-props on ref prop (#7584)
  fix(chip-group): Add existence checks (#7586)
  refactor(combobox, combobox-item, combobox-group): `getElementProp` is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent (#7562)
  build(deps): update dependency eslint-plugin-react to v7.33.2 (#7565)
  build(deps): update dependency quicktype-core to v23.0.71 (#7566)
  chore: release next
  fix(date-picker): set start of week to monday in zh-CN (#7578)
  chore: update translations (#7542)
  build: update browserslist db (#7554)
  ...
benelan added a commit that referenced this pull request Aug 24, 2023
…-failsafe

* origin/main: (29 commits)
  chore: release next
  refactor(combobox-item): drop unused variable (#7587)
  fix(combobox): update combobox height to follow design spec (#7558)
  fix(split-button): update divider and borders to follow design spec (#7568)
  fix(segmented-control): refresh items when added dynamically (#7567)
  chore: release next
  feat(action-bar, action-pad, action-group): Add label properties for group context (#7415)
  test(modal, shell): add delay to recent unstable stories (#7589)
  chore: release next
  fix(modal): handle removal of open attribute and prevent multiple beforeClose calls (#7470)
  fix(tree-item): move focus outline to item label area (#7581)
  chore: add explainers to disabled jsx-sort-props on ref prop (#7584)
  fix(chip-group): Add existence checks (#7586)
  refactor(combobox, combobox-item, combobox-group): `getElementProp` is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent (#7562)
  build(deps): update dependency eslint-plugin-react to v7.33.2 (#7565)
  build(deps): update dependency quicktype-core to v23.0.71 (#7566)
  chore: release next
  fix(date-picker): set start of week to monday in zh-CN (#7578)
  chore: update translations (#7542)
  build: update browserslist db (#7554)
  ...
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.

3 participants