-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(accordion, accordion-item):
icon-position
, icon-type
, `select…
…ion-mode` and `scale` can now be set as props or attributes (#7191) **Related Issue:** #6199, #6038, #6200 ## Summary This should resolve #6199, where you're able to set `accordionEl.setAttribute("icon-position", "start")`, but not `accordionEl.iconPosition = "start"`, happening because of a logical issue within `getElementProp` function. `getElementProp` is being refactored across child components as an outdated pattern in #6038, so this will also kick off that issue as well. Instead of the `accordion-item` looking up the parent for `iconPosition, iconType, selectionMode, or scale`, these get set by the `accordion` 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. With the `mutationObserver` added, there is no longer a need for the `calciteInternalAccordionItemRegister` event logic.
- Loading branch information
Showing
3 changed files
with
147 additions
and
92 deletions.
There are no files selected for viewing
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
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
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