BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.83k stars 3.4k forks source link

Input Text GUI element does not highlight all text correctly with click input #5471

Closed PatrickRyanMS closed 5 years ago

PatrickRyanMS commented 5 years ago

Bugs

deltakosh commented 5 years ago

Pinging @ssaket

ssaket commented 5 years ago

When double-clicking in an input text field, the action does not select all of the text in the box.

Isn't it right ? I took the idea from the bootstrap's input and this is how it works 2 clicks -> Select Text; 3 clicks-> Select All. Though I skipped the 3 clicks event. For reference - input_select_demo

There's also a property of inputText, onFocusSelectAll, which if set true would allow to select complete text on focus.

After double clicking and waiting a beat, part of the line will highlight, but the highlighted text does not seem consistent. Sometimes I get a whole word, sometimes I get a part of a word.

When you say- you get a part of a word, could you specify how many characters are missing like 1-2 or more ?

Click and drag does not select text in the input field.

This is something which we can surely add 👍

PatrickRyanMS commented 5 years ago

@ssaket, here are the two things that I am seeing.

doubleclickissue

selectingwholewordissue

selectwithperiod

You can see that the period in the float value is preventing the selection of the whole string, but I also get some strange partial selections on the long, generated string.

Thank you for looking into this and I definitely think we need click and drag selection as another action to the system as that is a very well known behavior and would be a likely backup if the multi-click to select all does not behave as the user expects. Please let me know if you have more questions.

ssaket commented 5 years ago

Awesome ! That's what I needed. Working on Fix.

deltakosh commented 5 years ago

Any update?

ssaket commented 5 years ago

Hey! Sorry I was on a vacation. The partial highlight as well as the beat delay after double click is fixed, working on the highlight on drag.

mysticfall commented 12 months ago

I tested with a fairly recent version (6.13.0) of Babylon.js, but the double-click text selection doesn't seem to work. I also tried the playground snippet linked above but none of the available versions made any difference.

Am I missing something, or was there a regression since this issue got resolved?