defold
defold copied to clipboard
gui.hide_keyboard does not work on iOS html5 safari
Describe the bug (REQUIRED)
gui.hide_keyboard does not hide the virtual keyboard on iOS html5 safari
To Reproduce (REQUIRED) Steps to reproduce the behavior:
- make a script
- make the script open the virtual keyboard using
gui.show_keyboard(showing the keyboard works perfectly well) - run
gui.hide_keyboardsome time after runninggui.show_keyboard - success
Expected behavior (REQUIRED)
gui.hide_keyboard hiding the keyboard
Defold version (REQUIRED):
- Version 1.6.4
Platforms (REQUIRED):
- Platforms: HTML5 (safari)
- OS: iOS 15.8.1
- Device: iPhone 7
How are you calling the gui.hide_keyboard()? On a timer? On a user action?
It is called by defolds on_input. Specifically for touch.
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
gui.hide_keyboard()
end
end
It is called by defolds
on_input. Specifically for touch.function on_input(self, action_id, action) if action_id == hash("touch") and action.pressed then gui.hide_keyboard() end end
HTML5 is a bit specific platform, taking into account all the security features that only allow calling certain functions using specific DOM events. Could you please test is using a special function we provide specifically for such cases html5.set_interaction_listener()? https://defold.com/ref/stable/html5/#html5.set_interaction_listener:callback
Tested with set_interaction_listener, still doesn't hide the keyboard. I confirmed that the callback was actually running as well.
Could you please check if you have anything in the console of the Safari Dev Tools when the device is connected and you perform the test?
https://developer.apple.com/documentation/safari-developer-tools/inspecting-ios
I do not own a Mac, are there any different tools that could be used?
I do not own a Mac, are there any different tools that could be used?
Maybe there's a way to read the log from Windows or Linux. I haven't looked.
I’ll dig into it, might take a few days though.
On Wed, 13 Mar 2024 at 07:53, Björn Ritzl @.***> wrote:
I do not own a Mac, are there any different tools that could be used?
Maybe there's a way to read the log from Windows or Linux. I haven't looked.
— Reply to this email directly, view it on GitHub https://github.com/defold/defold/issues/8652#issuecomment-1993685270, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX2GCJAM7EHIQB7P5AO3VK3YX7ZYFAVCNFSM6AAAAABEOLXDO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJTGY4DKMRXGA . You are receiving this because you authored the thread.Message ID: @.***>
As temporary solution you can use this:
html5.run('Module["canvas"].blur()')
Works on Iphone 8 Plus.