Fluent UI TagPicker: Is anyone able to reproduce the issue or am I making a mistake? #23428
-
I'm fairly new to implementing Fluent UI in SPFx and I came across an issue which I have tried to reproduce at https://codepen.io/kannan-balasubramanian/pen/RwQMQYL. I raised this as an issue at #23328, but I would like to know if my implementation is wrong and if I'm making a mistake. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you need to control the selected items during runtime, you are using the component in a controlled mode - it is your responsibility to maintain the list of selected items using the |
Beta Was this translation helpful? Give feedback.
-
Thank you, I was able to implement the clear functionality using the "onChange" event. |
Beta Was this translation helpful? Give feedback.
If you need to control the selected items during runtime, you are using the component in a controlled mode - it is your responsibility to maintain the list of selected items using the
selectedItems
prop. To remove the items, you should addonChange
callback, which is called when the "x" button is clicked and it is passed the updated items - you should store them to your state and re-render the component with the newselectedItems
.