Skip to content

Text fields do not accept input #8

@nspitko

Description

@nspitko

While text fields appear to accept focus, keystrokes are not handled by them. Additionally, the "backspace" key navigated backwards, indicating that nothing is handling key input.

Expected Behavior

Keypresses should be forwarded to the focused UI element

Current Behavior

Ze keyboard. It does nothing!

Test app / minimal test case

Run the following example, attempt to change the text field. You will need the pixi, haxeui-core, and haxeui-pixijs libraries, targeting js

import js.Browser;
import haxe.ui.Toolkit;
import haxe.ui.core.Component;
import haxe.ui.core.Screen;


class Main extends Application 
{

	public function new() 
	{
		super();

		autoResize = false;

		width = 640;
		height = 480;

		backgroundColor = 0x000000;

		onUpdate = _animate;

		var canvas = Browser.document.createCanvasElement();
		Browser.document.body.appendChild(canvas);

		super.start(null, null, canvas);

		Toolkit.init({
			stage: stage,      // the default place 'Screen' will place objects
			renderer: renderer // the renderer that is being used
		});

		var root:Component = Toolkit.componentFromString("<TextField text=\"Please change me :(\" />");

		Screen.instance.addComponent(root);
		
	}

	function _animate(e:Float) 
	{

	}

	static function main() 
	{
		new Main();
	}
}

Your Environment

  • Chrome 61 / Edge 40.1
  • Windows 10
  • Haxe 4 preview 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions