-
Notifications
You must be signed in to change notification settings - Fork 76
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
Elijbet
merged 11 commits into
main
from
origin/elijbet/6038-refactor-getElementProp-dropdown-item
Aug 24, 2023
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…p is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parent
Elijbet
added
the
refactor
Issues tied to code that needs to be significantly reworked.
label
Aug 23, 2023
…pdown-item-group, so there can be a mix of types within one dropdown
Elijbet
added
the
pr ready for visual snapshots
Adding this label will run visual snapshot testing.
label
Aug 24, 2023
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
driskull
approved these changes
Aug 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 🎈 👍
packages/calcite-components/src/components/dropdown/dropdown.tsx
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/components/dropdown-item/dropdown-item.tsx
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/components/dropdown-item/dropdown-item.tsx
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/components/dropdown-group/dropdown-group.tsx
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/components/dropdown-group/dropdown-group.tsx
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/components/dropdown-group/dropdown-group.tsx
Outdated
Show resolved
Hide resolved
Elijbet
changed the title
refactor(dropdown, dropdown-item-group, dropdown-item):
refactor(dropdown, dropdown-item-group, dropdown-item): Aug 24, 2023
getElementProp
is refactored out across child components as an outdated pattern in favor of inheritable props set directly on parentgetElementProp
is refactored out in favor of inheritable props set directly on parent
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
deleted the
origin/elijbet/6038-refactor-getElementProp-dropdown-item
branch
August 24, 2023 19:29
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)
8 tasks
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 amutationObserver
to do this as well aswatchers
for when it needs to modify the children.Inherited props addressed:
scale
is inherited fromdropdown
,selectionMode
is inherited fromdropdown-item-group
, so there can be a mix of types within one dropdown.