Skip to content

Editing a right-aligned decimal number using TextField(DECIMAL) makes the edited number jump to the lefthand side of the field #5370

Description

@ThomasH99

Tested with 7.0.258. I believe this behavior has changed recently. When editing a right-aligned decimal number, when you start editing the number by clicking in the field, the number jumps to the left side of the field.

If you add a hint like in the code below, it is gets even more confusing because when you start editing the field, the hint stays in the righthand end of field, while the editing cursor is placed in the left side which is easy to miss.

What is expected is the the number is edited on the righthand side of the field.

CSS:

TextField {
    text-align: right;
}

Code:

                Form form = new Form("Edit number", new BoxLayout(BoxLayout.Y_AXIS));
                TextField textField = new TextField("", "0", 10, TextArea.DECIMAL);
                textField.setUIID("ScreenItemComment");
                textField.setAlignment(TextField.RIGHT);

                form.getContentPane().setScrollableY(true );
                form.getContentPane().add( new Label("Label"));
                form.getContentPane().add( textField);
                form.getContentPane().add(new TextArea("another textArea"));
                form.show();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions