vassalengine / vassal

VASSAL, the open-source boardgame engine
https://vassalengine.org
GNU Lesser General Public License v2.1
431 stars 103 forks source link

MacOS: input constrained to a single character in long Key Command fields #11189

Open riverwanderer opened 2 years ago

riverwanderer commented 2 years ago

Observed on MacOS (don't know if this happens on other platforms too). Occurs at least as far back as v3.5.8.

The long Key Command fields (and other text fields) on such traits as Trigger Action etc get into a state whereby after type the first character into the field, the field seems to be forcibly selected such that a subsequent keypress just overwrites the first.

Workaround is to click away from the Key Command field and try again.

riverwanderer commented 2 years ago

this seems to be a fairly pervasive problem. It's one I may have noticed before but I seem to be getting it more frequently since I started using V3.6 (last two months).

Cattlesquat commented 2 years ago

I've never experienced this and am not able to reproduce it (I'm on Windows)

riverwanderer commented 2 years ago

Curious @flivni - have you come across this issue yet when using the Editor on MacOS ? It is a routine occurrence for me in recent months but no one else seems troubled by it.

riverwanderer commented 1 year ago

I've discovered a simple way to oftentimes reproduce this problem on Mac (may be worth retrying on Windows, @Cattlesquat). If this is not reproducible in windows, then presumably it is a MacOS/Java issue, unless there is some special MacOS code in Vassal handling this input ??

1) In the editor, in any component input field, select the first character - on its own or as part of a longer string. The bug seems to reproduce more reliably if you select from the righthand side of the string. 2) type a character to over-write that selection. 3) The bug may now be active... if so anything that you type will over-write the single character that is selected. If you type fast you can get up to 3 characters or so over-writing whatever was there before. You input remains selected regardless.

Expected behaviour: Once the initial selection is over-written, the selection should be cancelled and input should continue from that point.

Example showing the input field after step 2, with the bug active. Previously the "Re" of "Retire" was selected and overwritten with a single character:

image
riverwanderer commented 1 year ago

Oracle accepted report as Bug id JDK-8311949 but so far unable to reproduce. Action on me to produce a clip of the issue. I wonder if it is hardware related as I use a trackpad rather than a mouse.

riverwanderer commented 1 year ago

Short clip of the issue. Failure occurs at about 10 seconds after 2 or 3 successes:

https://github.com/vassalengine/vassal/assets/58135975/ee8d1bb5-8123-46db-b131-5668f0847d84

This recording on a MacBook (2016), MacOS Monterey (v12.6.7), Vassal 3.7, Java 20.