cuba icon indicating copy to clipboard operation
cuba copied to clipboard

Editable table returns focus to the previous row after selecting field in the next row using tab

Open Flaurite opened this issue 6 years ago • 6 comments

Environment

Description of the bug or enhancement

See Russian support forum: thread

First case:

  1. Edit field in the row
  2. Try to select next field in the row using tab

AR Next field is not focused.

First case

firstcase

Second case

  1. Edit field in the row
  2. Try to select field in the next row using tab key

AR Prevoius row is focused

Second case

secondcase

Flaurite avatar Feb 18 '20 07:02 Flaurite

Reproduced in 7.1 version too.

Flaurite avatar Feb 20 '20 14:02 Flaurite

Excuse me is it fixed? if fixed, please tell me in which version P.S. I am Using ext.cubaVersion = '7.1.1'

bekonti avatar Dec 13 '21 05:12 bekonti

Hi @bekonti ,

Most likely the issue won't be fixed. See discussion and workaround here: https://forum.cuba-platform.com/t/editable-table-wrong-focus-fw-7/9274/8. The workaround is to use generated columns with labels for non-editable columns:

@Inject
private MetadataTools metadataTools;

@Subscribe
public void onInit(InitEvent event) {
    for (Table.Column<Customer> column : customersTable.getColumns()) {
        if (!column.isEditable()) {
            column.setColumnGenerator(customer -> {
                Object value = customer.getValueEx(column.getIdString());
                return new Table.PlainTextCell(metadataTools.format(value));
            });
        }
    }
}

Flaurite avatar Dec 13 '21 06:12 Flaurite

@Flaurite Thanks for quick reply🤗 Unfortunately code you send me doesn't help

bekonti avatar Dec 13 '21 07:12 bekonti

@bekonti could you share a small demo project where the problem is reproduced?

Flaurite avatar Dec 13 '21 08:12 Flaurite

@Flaurite I've got same problem which exists in the Sampler https://demo10.cuba-platform.com/sampler/#main/15/sample?id=editable-table

small Demo in progress...

bekonti avatar Dec 13 '21 09:12 bekonti