draft-js icon indicating copy to clipboard operation
draft-js copied to clipboard

Confusion on usage of onTab vs. keyBindingFn

Open katz12 opened this issue 6 years ago • 2 comments

Do you want to request a feature or report a bug? More of a question about best practices. 'tab' inputs can be handled by onTab, but it seems like it is preferred to use keyBindingFn.

What is the current behavior? When a 'tab' character is input, only 'onTab' is invoked from editOnKeyDown.

This causes me some confusion since 'onTab' is marked as deprecated and emits a warning in the console when you use it in DEV.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/.

What is the expected behavior? I would expect both 'onTab' and keyBindingFn to be invoked while 'onTab' is supported but marked as deprecated.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? 0.10.5 Testing on Chrome for Mac

This is related to #792 and #1280.

katz12 avatar Mar 20 '19 22:03 katz12

This is fixed on v0.11.0-beta2

MunifTanjim avatar Jun 09 '19 21:06 MunifTanjim

Hi @MunifTanjim — as a follow-up to the question above, is onTab deprecated, or should that warning go away after v0.11.0? I am seeing the deprecation warning on v0.11.6, but it looks like onTab is still listed in the docs here and here.

Thanks!

pmillspaugh avatar Jan 26 '22 12:01 pmillspaugh