xatkit-bot-platform / xatkit-chat-widget

(React) Chat widget for Xatkit
https://xatkit.com
MIT License
5 stars 2 forks source link

After a button click the focus should be reset to the text input #12

Closed gdaniel closed 4 years ago

gdaniel commented 4 years ago

It's a bit annoying that we need to manually click on the text input bar after every button click if we want to enter some text. The focus should be reset to the text input bar after each interaction.

hamzaed commented 4 years ago

To solve this problem, we can create a ref in the parent component using React.createRef() then forward it using React.forwardRef((props, ref) => (...)).