question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabs doesn't support primitive MouseEvent

See original GitHub issue

Version

2.13.10

Environment

macOS 10.12.6, Chrome Version 61.0.3163.100 (Official Build) (64-bit)

Reproduction link

https://codepen.io/tylerlong/pen/rYmjEj?editors=0010

Steps to reproduce

Open the link https://codepen.io/tylerlong/pen/rYmjEj?editors=0010. Click tabs and watch console output.

What is expected?

Should trigger MouseEvent documented here: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button

What is actually happening?

Neither onClick nor onclick events of the tabs are triggered.

onTabClick event was triggered BUT you can only get the targetKey as argument, you cannot get the primitive MouseEvent documented here: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button


I created an issue which was closed without actually resolving: https://github.com/ant-design/ant-design/issues/8113

This time I created a new one with a reproducible link.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kaminskypavelcommented, Nov 10, 2020

a workaround in the meanwhile

                    <TabPane
                        tab={<div
                            onMouseUp={(e) => {
                                if (e.button == 1) {
                                    console.log("close me");
                                }

                            }}
                        >{pane.title}</div>}
                        key={pane.key}
                    >
                        {pane.content}
                    </TabPane>

pay attention to use onMouseUp and not onClick handler

0reactions
afc163commented, Jun 30, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tab component consuming mouse so tabs won't change
I have a problem that when I add a mouse listener to a component that is used as a tab, I can't switch...
Read more >
Re: How to send arguments to MouseEvent called fun... - Adobe ...
I know this is primitive, but hopefully it'll help out with your efforts. I believe you could use this structure and include a...
Read more >
Handling Events :: Eloquent JavaScript
For most types of events, the JavaScript event handlers are called before the default behavior takes place. If the handler doesn't want this...
Read more >
Family Diagram Configuration Objects
Family Chart control has API options similar to regular UI collection controls. It supports single node selection with the cursorItem property, mouse click,...
Read more >
Mouse events - Unity - Manual
In the Mouse event APIs and in this documentation, the term “mouse” refers ... Runtime panels don't receive this event when you enter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found