You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there's a change to the src attribute of an sp-icon used within a menu item, the selected item displayed by the picker should update to reflect the modified icon.
Actual behavior
Picker displays a stale icon associated with the selected menu item when the icon has changed to a new src value. The menu items shown in the popover are correct; only the copy shown in the picker button itself is stale.
Screenshots
What browsers are you seeing the problem in?
Firefox, Chrome, Safari, Microsoft Edge
How can we reproduce this issue?
See the sample code below. It displays repro steps that are easy to follow.
Sample code or abstract reproduction which illustrates the problem
I confirmed that calling the breakItemChildrenCache method of each MenuItem whenever I update its icon will indeed cause the Picker to display the correct icon. I wrote this hacky workaround to call the protected breakItemChildrenCache method:
const menuItems = this.shadowRoot.querySelectorAll('sp-menu-item')
for (const menuItem of menuItems) {
(menuItem as any).breakItemChildrenCache();
}
Of course, this is just a workaround — I should not have to call a protected method of a class I don't own.
Code of conduct
Impacted component(s)
Picker
Expected behavior
When there's a change to the
src
attribute of ansp-icon
used within a menu item, the selected item displayed by the picker should update to reflect the modified icon.Actual behavior
Picker displays a stale icon associated with the selected menu item when the icon has changed to a new
src
value. The menu items shown in the popover are correct; only the copy shown in the picker button itself is stale.Screenshots
What browsers are you seeing the problem in?
Firefox, Chrome, Safari, Microsoft Edge
How can we reproduce this issue?
See the sample code below. It displays repro steps that are easy to follow.
Sample code or abstract reproduction which illustrates the problem
https://studio.webcomponents.dev/edit/wF3pii8z9xOpdkyufNqu/src/index.ts?p=stories
Severity
SEV 3
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: