microsoft / fluentui-contrib

Monorepo for contributor extension packages to Fluent UI
MIT License
31 stars 35 forks source link

Fix: pass event to onValueChange #226

Closed george-cz closed 2 months ago

george-cz commented 3 months ago

This fixes an issue where the consumer wouldn't know if the onValueChange was triggered by a mouse or by keyboard. They might decide to react on the user finishing resizing, which, for a mouse is easy (onDragEnd) but for a keyboard we don't have such callback, since we trigger onValueChange each time a button is pressed and value updated.

By updating the event callbacks to be in better alignment with Fluent UI and using EventHandler, we can now determine if the source of onValueChange is keyboard by comparing the data.type attribute to EVENTS.keyboard