Components: Consolidate Slot Fill approaches #3132
Labels
[Feature] UI Components
Impacts or related to the UI component system
[Type] Task
Issues or PRs that have been broken down into an individual action to take
Previously: #2966
Related: #3082, #3075
In #2966, a Portal-based Slot Fill implementation was written in a refactor targeting the Popover component. This replaced all usage of the react-slot-fill library in the process. However, due to specific behaviors of event bubbling differences between portals and react-slot-fill, several issues were observed (#3082, #3075) and it was later partially reverted in #3083.
The React documentation includes a section on the specific event bubbling behavior for portals:
https://reactjs.org/docs/portals.html#event-bubbling-through-portals
Effectively, the difference between portal events and react-slot-fill events is that:
Neither of these is necessarily "correct", and both can be desired in specific circumstances. At this time, it does not appear that we have use for the React default event bubbling behavior of Portals, but given #3082 and #3075 we clearly do have need for the DOM event bubbling behavior (toolbar containers capturing events from slotted content).
Therefore, we should decide one of:
Another unrelated consideration for react-slot-fill is that we have observed multiple issue where lifecycle of slot content is not always predictable since component updates are reflected only after a subsequent state change. Therefore, we are motivated to either move away from the library or find a suitable fix for this issue.
The text was updated successfully, but these errors were encountered: