Hello,
SmartClient Version: v12.0p_2019-04-03/LGPL Development Only (built 2019-04-03), SmartGWT 12.0/LGPL
Chrome Version 73.0.3683.86 (Official Build) (64-bit) on Mac & Windows, appears on latest Firefox too
We have ListGrids using record components which our users use to edit some data. We have encountered an issue related to the browser's zoom setting which breaks the editing of the grid. We know the issue is related to browser zoom and we know the browser zoom related issues are hard or impossible to fix. We decided to report this problem because our users are experiencing significant trouble with this, this error was not present earlier and is of functional type.
With an editable ListGrid, we see that the cell focus (tab index) does not work correctly when the browser is zoomed. Also, the content of cells is lost on new records and on the row which is selected. The problem is somehow related to record components embedded in the cells or, at least the problem goes away if we remove all record components from the grid.
The problem is reproducible with the following test case (instructions will follow):
To reproduce:
1. Zoom the browser a bit, for example, 110% or 125%
2. Click "new row" button (notice that the first cell of the row is not automatically focused & editable)
3. Click the first cell of the new row
4. Enter some text, press tab to move to the next cell (notice that the content of the first cell disappears (?))
5. Click the first column of the first row
6. Tab forward in the grid to the next row (notice that the cell contents gets cleared when the new row is selected)
7. Zoom the browser to actual size (100%) and notice, that the problems go away
8. Comment out the "return new Label("a component here");" line from the code, and notice that the problems go away even in the zoomed mode
We have debugged the problem a bit and we see some weird behavior in the TabIndexManager when the grid tries to move the focus to and from the record component (A Label in this example). We have no idea if the problems presented in the editing of the grid are related to this.
If the only problem we would see here would be non-working tab indexes or something it would not be so bad. But the disappearing content and such is very troubling for some users. Any help or a possible workaround would be greatly appreciated.
SmartClient Version: v12.0p_2019-04-03/LGPL Development Only (built 2019-04-03), SmartGWT 12.0/LGPL
Chrome Version 73.0.3683.86 (Official Build) (64-bit) on Mac & Windows, appears on latest Firefox too
We have ListGrids using record components which our users use to edit some data. We have encountered an issue related to the browser's zoom setting which breaks the editing of the grid. We know the issue is related to browser zoom and we know the browser zoom related issues are hard or impossible to fix. We decided to report this problem because our users are experiencing significant trouble with this, this error was not present earlier and is of functional type.
With an editable ListGrid, we see that the cell focus (tab index) does not work correctly when the browser is zoomed. Also, the content of cells is lost on new records and on the row which is selected. The problem is somehow related to record components embedded in the cells or, at least the problem goes away if we remove all record components from the grid.
The problem is reproducible with the following test case (instructions will follow):
Code:
public void doOnModuleLoad() { viewport = new VLayout(); viewport.setWidth100(); viewport.setHeight100(); // our simple testing ds with some testing data final DataSource ds = new DataSource(); ds.setID("myDS"); DataSourceIntegerField f1 = new DataSourceIntegerField("f1"); f1.setPrimaryKey(true); f1.setHidden(true); DataSourceTextField f2 = new DataSourceTextField("f2", "f2", 20000); DataSourceTextField f3 = new DataSourceTextField("f3", "f3", 20000); ds.setFields(f1, f2, f3); ds.setClientOnly(true); final ListGridRecord r1 = new ListGridRecord(); r1.setAttribute("f1", 1); r1.setAttribute("f2", "first value"); r1.setAttribute("f3", "second value"); final ListGridRecord r2 = new ListGridRecord(); r2.setAttribute("f1", 2); r2.setAttribute("f2", "third value"); r2.setAttribute("f3", "fourth value"); ds.setTestData(r1, r2); // our editable grid in saveLocally mode final ListGrid g = new ListGrid() { @Override protected Canvas createRecordComponent(ListGridRecord r, Integer col) { // create a record component to cell nr 3 if(col == 2) { // by commenting this out, everything works return new Label("a component here"); } return null; } }; g.setAutoSaveEdits(false); g.setDataSource(ds); g.setAutoFetchData(false); g.setSaveLocally(true); g.setCanEdit(true); g.setEditByCell(false); g.setEditEvent(ListGridEditEvent.DOUBLECLICK); g.setSelectionType(SelectionStyle.SINGLE); g.setShowRecordComponents(true); g.setShowRecordComponentsByCell(true); // two text cols & component col ListGridField gf2 = new ListGridField("f2"); AutoFitTextAreaItem aEditor = new AutoFitTextAreaItem(); gf2.setEditorProperties(aEditor); gf2.setCanEdit(true); ListGridField gf3 = new ListGridField("f3"); AutoFitTextAreaItem bEditor = new AutoFitTextAreaItem(); gf3.setEditorProperties(bEditor); gf3.setCanEdit(true); ListGridField gcf = new ListGridField("gcf"); gcf.setCanEdit(false); g.setFields(gf2, gf3, gcf); // fetch data to grid ds.fetchData(new Criteria(), new DSCallback() { @Override public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) { g.setData(dsResponse.getData()); } }); viewport.addMember(g); // button to add new rows Button b = new Button("new row"); b.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { // add a new row ListGridRecord newRecord = new ListGridRecord(); g.addData(newRecord); g.selectSingleRecord(newRecord); g.startEditing(g.getRecords().length - 1, 0, false); } }); viewport.addMember(b); viewport.draw(); }
1. Zoom the browser a bit, for example, 110% or 125%
2. Click "new row" button (notice that the first cell of the row is not automatically focused & editable)
3. Click the first cell of the new row
4. Enter some text, press tab to move to the next cell (notice that the content of the first cell disappears (?))
5. Click the first column of the first row
6. Tab forward in the grid to the next row (notice that the cell contents gets cleared when the new row is selected)
7. Zoom the browser to actual size (100%) and notice, that the problems go away
8. Comment out the "return new Label("a component here");" line from the code, and notice that the problems go away even in the zoomed mode
We have debugged the problem a bit and we see some weird behavior in the TabIndexManager when the grid tries to move the focus to and from the record component (A Label in this example). We have no idea if the problems presented in the editing of the grid are related to this.
If the only problem we would see here would be non-working tab indexes or something it would not be so bad. But the disappearing content and such is very troubling for some users. Any help or a possible workaround would be greatly appreciated.
Comment