britzl / gooey

Defold GUI system
MIT License
150 stars 22 forks source link

Using character . after numbers will introduces extra characters on mobile #60

Closed Jerakin closed 2 years ago

Jerakin commented 4 years ago

If you do 1.23 it will/might automatically expand into 1.11.23

Here are some other examples 123.45 -> 123.123123.45 123.ab -> 123.33.ab ab.123 -> ab.123 . -> .

It feels like it start doing odd stuff as soon as there is a . and some recommended/auto correction text.

britzl commented 4 years ago

I tried to reproduce this but failed. I need a bit more info:

Jerakin commented 4 years ago

I used the gooey example project, happens in all fields that take character input. Only tried it on Android (two different). Android version 10 (both).

Engine 1.2.171

Jerakin commented 4 years ago

I also noticed that I can do 12. and click space to get 12.1212. so I don't need to do "two character" after the . to get it to expand.

Jerakin commented 4 years ago

I checked iOS and it doesn't happen there, I guess you tried on iOS before?

Jerakin commented 4 years ago

I have some good news and some bad news!

Good news first, I don't think this is Gooeys fault. The bad news are that I think it's Defold fault.

I made a simple test project with only this gui_script in it

function init(self)
    msg.post(".", "acquire_input_focus")
    gui.show_keyboard(gui.KEYBOARD_TYPE_DEFAULT, false)
    self.str = ""
end

function on_input(self, action_id, action)
    if action_id == hash("text") then
        self.str = self.str .. action.text
        print(action.text, self.str)
        gui.set_text(gui.get_node("text"), self.str)
    end
end

When I write the string 12.345 this is what happens character by character: 1 DEBUG:SCRIPT: 1 1 2 DEBUG:SCRIPT: 2 12 . DEBUG:SCRIPT: . 12. 3 DEBUG:SCRIPT: 3 12.3 4

5 DEBUG:SCRIPT: 12.345 12.312.345

When I write 4 the log doesn't say anything

Test project

britzl commented 2 years ago

I'm not able to reproduce this problem. Closing.