react-console-emulator icon indicating copy to clipboard operation
react-console-emulator copied to clipboard

Add callback prop for tab

Open suffle opened this issue 4 years ago • 4 comments

This PR adds a callback prop that is called, when the tab key is pressed. This allows developers to add their own autocomplete feature

suffle avatar Mar 20 '21 15:03 suffle

Very cool, will test it :)

It prevents the default tabbing in the browser correct?

Sebobo avatar Mar 22 '21 09:03 Sebobo

Very cool, will test it :)

It prevents the default tabbing in the browser correct?

That is correct, although I am open about the api. We could also call the callback with the event as its argument, then it is up to the developer to choose the behavior completely. I opted for the slightly simpler API here.

suffle avatar Mar 22 '21 17:03 suffle

Hi, thanks for the PR! Unfortunately, I'm in a bit of a personal conundrum right now, so it will probably take me a little while to get to review this one. Don't want to give any firm timelines right now, but I promise I'll get to it eventually! Thanks for understanding 😄

linuswillner avatar Mar 24 '21 19:03 linuswillner

Applied it as patch and works perfectly when following the provided example 👍

Now thinking about how to provide a feedback if there are more matches or when trying to complete more than the command name.

Sebobo avatar Mar 30 '21 14:03 Sebobo