Cannot enter spaces in textField or textArea with textChangeEventMode="EAGER"

Jmix version: 1.5.4
Jmix Studio plugin version: 1.5.5-231
IntelliJ IDEA 2023.1.2 (Community Edition)
Build #IC-231.9011.34, built on May 16, 2023
Runtime version: 17.0.6+10-b829.9 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
GC: G1 Young Generation, G1 Old Generation
Kotlin: 231-1.8.21-IJ9011.34
Java 17.0.4 2022-07-19 LTS
Java™ SE Runtime Environment (build 17.0.4+11-LTS-179)
Java HotSpot™ 64-Bit Server VM (build 17.0.4+11-LTS-179, mixed mode, sharing)
Operating System: macOS 13.6 (22G120)
File System: Case-Sensitive Journaled HFS+ (APFS)
Browser: Safari - Version 16.6 (18615.3.12.11.2)
Database: PostgreSQL 13

Hello Everyone

If textChangeEventMode=“EAGER”, then I cannot enter any spaces in my textField or textArea.

<textField id="cityLookupField" caption="msg:///cityLookupFieldCaption"
                                       dataContainer="perfDc" property="city"
                                       textChangeEventMode="EAGER"/>

For example, if I type, “This is a test.”, the result is “Thisisatest.”

If I leave the textField and navigate to another component, and then return the focus to the textField, I can then enter spaces and correct the input.

Unfortunately, I do not know when this started because I have been analyzing and refactoring some other code for quite some time.

As mentioned above, the same problem exists for the textArea component, though I am not sure if the textChangeEventMode attribute is supported for it? Can you please confirm this.

If I remove textChangeEventMode=“EAGER” from my descriptor and hot-deploy the file, I can enter spaces as expected and I can reproduce this behavior in several screens.

Maybe this is a partial regression of this topic: textChangeEventMode EAGER bug with trimmed spaces

Can you please analyze and correct this quickly. Thanks in advance for your support.

Best regards
Chris

Hi!

Have you tried using the trim = false attribute, as in the attached topic?
And your problem still persists?

Regards,
Dmitriy

@d.kremnev
Hi Dmitriy

Thank you for the feedback and support. In the description of the textChangeEventMode EAGER bug with trimmed spaces post, I understood the statement

try to enter a space at the end of the line in the text field in the edit screen

as only considering a space(s) that was removed from the end of the line when the input had completed and not during the input itself. Since I did not have this behavior before, for reasons I cannot explain now, I had assumed that the resolution of textChangeEventMode EAGER bug with trimmed spaces was actually a workaround.

As you suggested, I tried setting trim=false and I could enter my text, however, this does not work for all use cases (see below).

In my opinion it is only logical to trim a leading or training space(s) from the input text after the input has completed, either when the user enters a <return> or <enter> key or by navigating to another component, thereby moving the input focus to another object.

Using the EAGER setting, I have the possibility to immediately remove a space, or any other character for that matter, so it does not make sense to me that the trimming is done before the user has completed their input. In my opinion, the EAGER setting should have no affect on the trim functionality. Furthermore, if EAGER is set and I set trim=false, so that the user can enter spaces between words, and the user adds an extra space(s) at the beginning or end of his input, I will have to trim that myself. That does not make sense to me.

Can you please think through the situations I have just described and give me some more feedback.

Thanks in advance.

Best regards
Chris