britzl / gooey

Defold GUI system
MIT License
150 stars 22 forks source link

If the text haven't been committed it should _probably_ be discarded. #50

Closed Jerakin closed 5 years ago

Jerakin commented 5 years ago

This is only applicable on device. This needs to be discussed before it can be merged.

Current behaviour

  1. Input text
  2. Click outside of the node
    • The text you put in stays
    • gui.get_text returns the text
  3. Click the node again
    • The text input gets cleared

I personally think that one of these two options is more intuitive

Expected behavior 1 (this PR)

  1. Input text
  2. Click outside of the node
    • The text input gets cleared

Expected behavior 2 (don't "mark text")

  1. Input text
  2. Click outside of the node
    • The text you put in stays
    • gui.get_text returns the text
  3. Click the node again
    • The text you put in stays

I think it could be beneficial to use behavior 1 and have a option INPUT.set_auto_commit_text(input, commit) so the user can skip the "need to press enter" (which I personally would always use)

britzl commented 5 years ago

Personally I think option 1 is enough. If there's someone asking for option 2 then it can be added.