Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't attach event handlers in tab title #384

Open
sebakerckhof opened this issue Apr 3, 2023 · 1 comment
Open

Can't attach event handlers in tab title #384

sebakerckhof opened this issue Apr 3, 2023 · 1 comment

Comments

@sebakerckhof
Copy link

sebakerckhof commented Apr 3, 2023

Describe the bug

I'm trying to add an additional clickable icon in the tab name (similar to the close icon, but for a different action).
I tried by just passing a <button onClick={eventHandler}>Click me</button> as tab name directly or via renderValues.content / renderValues.leading / renderValues.buttons in the onRenderTab callback. The button is displayed, but the click handler is not called, when inspecting there's a 'noop' click handler instead.

Your Example Website or App

https://jsfiddle.net/sebakerckhof/d6guxL0q/7/

Steps to Reproduce the Bug or Issue

Add a clickable target in the tab name and try clicking on it.

Expected behavior

Click handler is called

Operating System

Ubuntu 22.04

Browser Type?

Chrome

Browser Version

111.0.5563.64

Screenshots or Videos

image

Additional context

No response

@sebakerckhof sebakerckhof changed the title Can't attach event handlers in tab leading/content Can't attach event handlers in tab title Apr 3, 2023
@lceric
Copy link

lceric commented May 4, 2023

<div onClick={eventHandler} onMouseDown={(e)=> e.stopPropagation()} ></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants