flixel-ui icon indicating copy to clipboard operation
flixel-ui copied to clipboard

FlxInputText on JS crashes with when trying to make text go multiline

Open ShaharMS opened this issue 2 years ago • 4 comments

  • haxe version - 4.2.4
  • flixel version - 4.11.0
  • flixel-ui version - 2.4.0

the title explains it. code snippet to reproduce the crash quickly:

var input = new FlxInputText(100, 100, 300, 15);
input.wordWrap = true;
add(input);
input.text += "\n";

I'm using Firefox and it crashes with shader is null: image

you can also just add lots of letters/words instead of the "\n"

ShaharMS avatar Feb 12 '22 18:02 ShaharMS

I was able to get the same issue to occur, but only when using the "\n" newline character. It may be related to this: https://stackoverflow.com/questions/23401536/newline-characters-n-r-not-being-respected-with-openfl-flash-text-textfield

DigiEggz avatar Apr 17 '22 22:04 DigiEggz

Tbh I got to fixing it, it's just that all of the conditionals are redundant and the isated code is causing the issue. For now I'm just using another version of FlxInputText

ShaharMS avatar Apr 17 '22 22:04 ShaharMS

Good to hear. Can I ask which version of FlxInputText you're using?

DigiEggz avatar Apr 18 '22 17:04 DigiEggz

It's the one on my haxelib (texter), I link the github 9ne cause it's more comfortable to read:

https://github.com/ShaharMS/texter/blob/main/src/texter/flixel/_internal/FlxInputText.hx

ShaharMS avatar Apr 18 '22 17:04 ShaharMS