v4.0.0
Changelog
Highlighted Changes
- docs(rfcs): change handler consistency (#372)
Other Changes
- docs(issues): redirect uber employees to internal link (#405)
- test(tooltip): add tooltip end-to-end tests (#403)
- refactor(tooltip): examples (#401)
Migration Guide
Purpose
The purpose of this change was to converge on a standardized way of using change handlers.
In Base UI we follow this event handler pattern:
- for custom handlers, or handler overrides with custom logic, we use the
onChange({event, value})
method signature, - pass-through handlers, such as
onBlur
oronMouseEnter
are not changed.
Select
- onChange: function(event, params)
+ onChange: function({event, type, option, selectedOption})
Menu
- function onItemSelect(item) {...}
+ function onItemSelect({item}) {...}
Modal
- function onClose(source) {...}
+ function onClose({source}) {...}
Tag
- function onActionClick(event, children) {...}
+ function onActionClick({event, children}) {...}
Pagination
- function onPrevClick(event) {...}
+ function onPrevClick({event}) {...}
- function onNextClick(event) {...}
+ function onNextClick({event}) {...}
- function onPageChange(nextPage, prevPage) {...}
+ function onPageChange({nextPage, prevPage}) {...}