fluentui
fluentui copied to clipboard
[Bug]: Facepile addButtonProps does not override default addButton.
Library
Web Components (@fluentui/web-components)
System Info
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory: 16.33 GB / 31.85 GB
Browsers:
Edge: Spartan (44.22621.1702.0), Chromium (113.0.1774.50)
Internet Explorer: 11.0.22621.1
Are you reporting Accessibility issue?
no
Reproduction
https://codepen.io/fitzeris/pen/yLRmyEX
Bug Description
Actual Behavior
- Make showAddButton true, then try to pass in a different iconProps to addButtonProps. The default addButton doesn't get replace, and both the new button and the old will be rendered.
Expected Behavior
The default addButton would be overwritten by the newly passed in icon.
Logs
No response
Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] The provided reproduction is a minimal reproducible example of the bug.
This is pretty clearly React and not Web Components. Unassigning myself and removing the web-components tag.
you are using the API wrong. what needs to be done is to use following addButtonProps={{iconProps:{iconName: 'add'}}}
which will render that add icon, although I don't think it's intended to work that way as it breaks the UI
.
based on facepile API there is no official way how to change the icon within addButton - that's why it's called add button right ?
@Hotell So even though we can pass in iconProps through addButtonProps within facepile, it's not actually possible to change the icon for the add button?
Because this issue is marked as by design and has not had activity for over 3 days, we're automatically closing it for house-keeping purposes.
Because this issue is marked as by design and has not had activity for over 3 days, we're automatically closing it for house-keeping purposes.
@Hotell So even though we can pass in iconProps through addButtonProps within facepile, it's not actually possible to change the icon for the add button?
@fitzeris, the reason why it "supports" iconProps is because Facepile is using a BaseButton to render the add personas button:
Now you can actually add it by doing what Martin is doing, but that is not correct since the button is a null render and you are forcing it to render the icon. I would strongly recommend against it. I'll close this as by design. You could try adding a custom Persona to mimic the behavior you want to achieve.