Skip to content

hooks: pass Event in the onChange handlers #986

@silviuaavram

Description

@silviuaavram

Problem description:

Have onChange handlers behave as in any react event handler. Our handlers should be similar to:

// desired state
onSelectedItemChange = (event, {selectedItem, type}) => { ... } 

// current state
onSelectedItemChange = ({selectedItem, type}) => { ... }

Suggested solution:

Pass event in dispatch action and use that in callOnChangeProps for all handlers (onStateChange, onIsOpenChange etc).

This is a breaking change, as it will add the event as first parameter to these handlers, and the second parameter will be the current first one (changes + type).

Typescript typing should also be updated.

Since we already have #985 that contains breaking changes to handlers, these should be both included in a breaking changes release (v6).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions