tabs icon indicating copy to clipboard operation
tabs copied to clipboard

option to disable key events

Open ghost opened this issue 8 years ago • 5 comments

I think a boolean prop that enables/disables the key event listeners would make a great addition. If you agree I'm happy to create a PR :)

ghost avatar Sep 30 '16 14:09 ghost

Your use case?

benjycui avatar Dec 06 '16 03:12 benjycui

Hi, I would find this useful as well. I'm using the Antd framework, which builds on top of rc-tabs.

I need to de-activate the rc-tabs keyboard shortcut because I want to implement my own. At the moment when the keyboard shortcuts are pressed, both my custom key handler and the rc-tabs handler are called and the tabs component switches by two tabs instead of one.

Also, the rc-tabs keyboard shortcut only seem to work when the component is focused 🤔

Thanks!

matthieualouis avatar Feb 13 '17 19:02 matthieualouis

@callodacity whould you like to give us a PR?

paranoidjk avatar Mar 02 '17 12:03 paranoidjk

According to me, we had better follow W3C's suggestion.

So, I don't know why you need to implement your own.

If you find any conflict between rc-tabs and W3C's suggestion, just PR to modify it, thanks.

benjycui avatar Mar 03 '17 01:03 benjycui

@benjycui, found a conflict with W3C. It advises against binding up and down arrow keys on horizontal tabs: "If the tab list is horizontal, it does not listen for Down Arrow or Up Arrow so those keys can provide their normal browser scrolling functions even when focus is inside the tab list." W3C

MarianSulgan avatar May 07 '19 11:05 MarianSulgan