How to dismiss keyboard on mobile

Bob Sneidar bobsneidar at iotecdigital.com
Thu May 10 11:29:28 EDT 2018


It's not something you would put in a field. Focus on nothing is something you send to lose focus on any object that currently has the focuw. 

For instance, you have a field which calls a validation function upon closeField. You have a button that saves the information in the field somewhere. At least on MacOS, clicking the button does NOT cause the field to lose focus, because on MacOS a button cannot HAVE the focus. Hence your validation script will never trigger, and you might save bad data. 

So in the mouseUp handler of the button, the first line could be focus on nothing. This will trigger the closeField message of the field and execute your validation script. 

Bob S
 

> On May 10, 2018, at 07:28 , Sannyasin Brahmanathaswami via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> on returnInField
>   focus on nothing
> end returninfield
> 
> # when I put that into field itself: does nothing: 
> # on android I get a carriage return in the field on hitting returnkey
> 
> maybe it has to do with what Jacqueline said "
> 
> "These are just messages that the engine sends when the focus changes,
> they don't control the field themselves. As mentioned, "focus on
> nothing" is the command that does the actual work."
> 
> But I would rather they don't have to click another control, other than the return key while inside the field itself
> 
> BR
> 
> 
> 
>    That is what I do whenever I need a closeField or exitField to trigger on a currently entered field before running off and doing things. focus on nothing is what you want. 
> 
>    Bob S
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list