I am using an input box to enter values. There is a callback which returns some output based on text in the input box. I have set the debounce option as True.
However, every time if I need to enter a new text, I have to first delete the previous input text.
Is it possible to automatically clear the text written in the input box after I press the Enter button?
I think the proper way to do that is
command + backspace or
ctrl + backspace rather than pressing Enter, Enter key and/or Tab key are the triggers to cancel the debounce delay.
What works for me is setting the
value parameter to
'' - i also update the
placeholder parameter to indicate success or failure as my input is used for password validation.
Thanks @flyingcujo. I just created another callback with output as the text box and input as a “clear” button and returned
''. This worked for me.
Thanks @byronz. Though your solution helps me in easily clearing the input, but I was looking more of a clear button kind of solution. With ctrl+backspace, I need to press it every time for each word (I have a sentence to clear).
@tushar on mac, cmd + backspace clears everything, might be different on other systems
but you might get more hints from here https://www.howtogeek.com/115664/42-text-editing-keyboard-shortcuts-that-work-almost-everywhere/