DataGrid headers hightlighted in blue after Migration to 2.6.1

Dear JMIX Team,

With JMIX 2.6.0 headers in datagrid where no highlighted with a blue rectangle when you first access the screen.

image

Now after the upgrade to JMIX 2.6.1 all datagrid headers are displayed with blue rectangle when you access the screen for the first time like image below:

image

This hightligh dissapears after you move the mouse to another point in the screen but it would be nice to come back to the previous behaviour.

Same here

Hello!

The focus begins to appear after this fix: DataGrid specified in `focusComponent` does not receive focus · Issue #4628 · jmix-framework/jmix · GitHub. This is a correct behavior, if you specify in your view descriptor focusComponent attribute:

<view xmlns="http://jmix.io/schema/flowui/view"
      focusComponent="usersDataGrid"
      ...>
    ...
</view>

If you want to keep the old behavior, use the following solutions:

  1. Remove the focusComponent attribute or change its value to another component ID.
  2. Add the following selector to your theme:
    vaadin-grid[navigating]::part(row):focus::before {
       box-shadow: none;
    }
    
    Note, this style will disable focus for all DataGrid rows.
  3. More specific style. Create /components/vaadin-grid.css file in your theme folder and add the following selector:
    :host([navigating]) thead [part~='row']:focus::before {
      box-shadow: none;
    }
    
1 Like

Hi @pinyazhin

Thank you for the great explanation !

Is there an easy way to have the focus on the first entity in the datagrid ?

Best regards

Felix

It is not a trivial task, since Vaadin Grid only has focus() which sets focus on the header. Additionally, it will require writing client-side code to focus a specified row or cell.

Upd. Grid#focus() still does not work, because Vaadin issue is not resolved: Grid#focus() seems to be broken · Issue #2180 · vaadin/flow-components · GitHub. In Jmix it works only with focusComponent attribute in XML descriptor.

Thank you for the quick reply, the suggested solution works perfectly.

1 Like