Exit keyboard (entry) when done clicked

Exit keyboard (entry) when done clicked

BY 19 Aug 2019 Native Application Development

I have configured an entry (keyboard) to replace the return key with ‘DONE’.  This is a single line entry.

Now I would like clicking the done key to trigger closing the keyboard.  How should I do this?

1. Do I have to listen for every change to the text awaiting a ‘\n’ ?  If so how.

2. Do I have to manually remove the ‘\n’ from the text after I get it from the entry component?  Or can I prevent the ‘\n’ from being inserted/appended to the entry text?

 

I could not find a signal from the Entry that would indicate done was clicked.  I seem to recall that I read that somewhere, but can’t find where that signal would be.

 

Written by