mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix scrolling and column title bugs
Summary: On Firefox and Safari, setting scrollLeft to a max safe integer was causing it to be treated as 0. It's not clear why - for now, the scrollWidth is used instead. Also fixes a bug where the column title popup wouldn't appear for a new column if tab was previously used to close the same popup for the last column. Test Plan: Browser test. Reviewers: JakubSerafin Reviewed By: JakubSerafin Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3911
This commit is contained in:
parent
41280a31f2
commit
0b64e408b0
@ -733,7 +733,7 @@ GridView.prototype.renameColumn = function(index) {
|
||||
};
|
||||
|
||||
GridView.prototype.scrollPaneRight = function() {
|
||||
this.scrollPane.scrollLeft = Number.MAX_SAFE_INTEGER;
|
||||
this.scrollPane.scrollLeft = this.scrollPane.scrollWidth;
|
||||
};
|
||||
|
||||
GridView.prototype.selectColumn = function(colIndex) {
|
||||
@ -958,8 +958,13 @@ GridView.prototype.buildDom = function() {
|
||||
|
||||
var renameCommands = {
|
||||
nextField: function() {
|
||||
editIndex(editIndex() + 1);
|
||||
self.selectColumn(editIndex.peek());
|
||||
if (editIndex() === v.viewFields().peekLength - 1) {
|
||||
// Turn off editing if we're on the last field.
|
||||
editIndex(-1);
|
||||
} else {
|
||||
editIndex(editIndex() + 1);
|
||||
self.selectColumn(editIndex.peek());
|
||||
}
|
||||
},
|
||||
prevField: function() {
|
||||
editIndex(editIndex() - 1);
|
||||
|
@ -364,6 +364,23 @@ describe('DescriptionColumn', function() {
|
||||
await revert();
|
||||
});
|
||||
|
||||
it('should reopen editor when adding new column', async () => {
|
||||
// This partially worked before - there was a bug where if you pressed tab on
|
||||
// the last column, and then clicked Add Column, the editor wasn't shown, and the
|
||||
// auto-generated column name was used.
|
||||
const revert = await gu.begin();
|
||||
await doubleClickHeader('E');
|
||||
await gu.sendKeys(Key.TAB);
|
||||
assert.isFalse(await popupVisible());
|
||||
|
||||
await addColumn();
|
||||
assert.isTrue(await popupVisible());
|
||||
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
await gu.waitForServer();
|
||||
await revert();
|
||||
});
|
||||
|
||||
it('should support basic edition on CardList', async () => {
|
||||
const mainSession = await gu.session().teamSite.login();
|
||||
const api = mainSession.createHomeApi();
|
||||
|
Loading…
Reference in New Issue
Block a user