Skip to content

Add optional callback for tab change events #1072

@james1q2w3e

Description

@james1q2w3e

Is your feature request related to a problem? Please describe.
Not a problem with this library (is very nice), simply a feature that would make certain circumstances easier to tackle,

Describe the solution you'd like
An optional method on Dockview (React) that allows one to watch the tab-change event. Specifically being able to conditionally prevent/allow a user to change tabs via clicking on it.

Basically, I need to be able to perform a check/validation to decide if the user really wants to change the tab.

Describe alternatives you've considered
I have tried to add an event listener on the tabs. While I can successfully do this on the tab close-action-button, I am unable to do this on the tab itself, as the event will only be fired after the tab has changed (I believe this is because of how React handle event propagation..?)

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions