Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing NumberStepper textfields creates runtime error #37

Open
mundusnine opened this issue Nov 21, 2019 · 0 comments
Open

Editing NumberStepper textfields creates runtime error #37

mundusnine opened this issue Nov 21, 2019 · 0 comments

Comments

@mundusnine
Copy link
Contributor

When editing textfields of numbersteppers with float values if we press repeatedly the arrows to select a section and then try to use backspace to remove text we create an error in how the fonts are rendered.

Expected Behavior

No bug should occur when editing the textfield of a numberstepper. I.e. the issue could be coming from the numberstepper adding to the pos value when using the arrow keys.

Current Behavior

When trying to edit textfields of numbersteppers it's bug out and jams the UI. The error message in the debug console outputs this:

TypeError: Cannot read property 'xadvance' of undefined
    at kha_KravurImage.getCharWidth (/home/jsnadeau/Kha/Sources/kha/Kravur.hx:99:28)
    at kha_KravurImage.charactersWidth (/home/jsnadeau/Kha/Sources/kha/Kravur.hx:117:13)
    at kha_Kravur.widthOfCharacters (/home/jsnadeau/Kha/Sources/kha/Kravur.hx:207:15)
    at haxe_ui_backend_kha_TextField.render (/home/jsnadeau/foundsdk/haxeui-kha/haxe/ui/backend/kha/TextField.hx:866:44)
    at haxe_ui_core_TextInput.renderTo (/home/jsnadeau/foundsdk/haxeui-kha/haxe/ui/backend/TextInputImpl.hx:101:9)
    at haxe_ui_components_TextField.renderTo (/home/jsnadeau/foundsdk/haxeui-kha/haxe/ui/backend/ComponentImpl.hx:163:13)
    at haxe_ui_components_NumberStepper.renderTo (/home/jsnadeau/foundsdk/haxeui-kha/haxe/ui/backend/ComponentImpl.hx:169:13)

Possible Solution

If the issue is coming from the numberstepper incrementing/decrementing to the pos value when using the arrow keys removing this feature when editing the text could be a solution.

Steps to Reproduce (for bugs)

  1. Start editing textfield of numberstepper
  2. Try selecting a section, then use backspace while using the arrows.

Media

Test app / minimal test case

Context

Trying to have editable numbersteppers

Your Environment

  • Version used: haxeui-kha git version
  • Environment name and version (e.g. Chrome 39, node.js 5.4): kha debug-html5
  • Operating System and version (desktop or mobile): Linux debian 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant