-
Notifications
You must be signed in to change notification settings - Fork 158
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
[Filter panel] Heading knob not updating #7441
Comments
While looking into #6677, I noticed that the storybook knobs would not update the filter panel heading as expected (#7441), so it seems that the props and internal state need to be reconciled for this to be resolved. Resolving this should also improve support for translated strings, as the "Filter" heading is currently hard coded |
…on (#7452) ### Related Ticket(s) #6677 ### Description This PR resolves an issue with the filter panel where panel groups would unexpectedly collapse on selection of filter items. It also addresses the issue of inconsistent filter panel headings, so it now reflects the number of selections in the standalone filter panel (matching the filter panel modal) https://user-images.githubusercontent.com/8265238/138103411-8225e811-1446-4dce-88db-20a9cef12670.mov It looks like the light DOM controls the filter panel modal and the shadow DOM controls the standalone filter panel. I'm a bit iffy on changing light DOM attributes after iterating through the shadow DOM but I think this approach is required given the current construction of the component (need some more feedback on that) While looking into this, I noticed that the storybook knobs would not update the filter panel heading as expected (#7441), so it seems that the props and internal state need to be reconciled for this to be resolved. Resolving this should also improve support for translated strings, as the "Filter" heading is currently hard coded. The component may be due for a refactor but that can probably be done separately from the work for #6677 ### Changelog **Changed** - making selections in the standalone filter panel (large viewport widths) should no longer collapse filter groups - filter panel heading now matches filter panel modal **Removed** - unused component methods <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
@jkaeser I'm going to assign this issue to you since you've been working on the Filter Panel component. 👍 |
This isn't a bug with the Storybook configuration; the light DOM heading element does update when the knob value changes. However, this doesn't trigger anything in the composite to re-render the heading in the other places it is used. Ideally we can emit an event from the |
### Related Ticket(s) Resolves #7441 ### Description The `<dds-filter-panel-composite>`'s heading appears in multiple places, each of which is essentially copied from a source `<dds-filter-panel-heading>` in the `heading` slot. The problem was that changes to this source were not being reflected in all the places that copy it (i.e. the modal button, the modal header, and the desktop header). The changes in this PR result in changes to the story's "heading" knob updating the heading everywhere it appears. ### Changelog **New** - `DDSFilterPanelHeading` emits an event when its slotted content changes. - `DDSFilterPanelComposite` propagates changes to source header to modal button text, modal header text, and desktop header text. **Changed** - Changes to the "heading" knob are reflected in the component. <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
Engineering info:
Description
When changing the filter panel
heading
knob in Storybook, the filter panel heading value does not updateComponent(s) impacted
Filter panel
Browser
No response
Carbon for IBM.com version
canary
Severity
Severity 3 = The problem is visible or noticeable to users but does not impede the usability or functionality. Affects minor functionality, has a workaround.
Application/website
Package
@carbon/ibmdotcom-web-components
CodeSandbox example
https://ibmdotcom-web-components-canary.mybluemix.net/?path=/story/components-filter-panel--default
Steps to reproduce the issue (if applicable)
heading
knobScreen.Recording.2021-10-19.at.12.16.51.PM.mov
Release date (if applicable)
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: