mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fixing scrollbars on ace editor for windows users.
Summary: Fixing formula editor scrollbars for windows users. Test Plan: Manual Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D3087
This commit is contained in:
parent
e5beafb256
commit
8eeeae7fbf
@ -245,8 +245,14 @@ AceEditor.prototype.resize = function() {
|
|||||||
size = this.calcSize(this._fullDom, desiredSize);
|
size = this.calcSize(this._fullDom, desiredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editorDom.style.width = size.width ? size.width + 'px' : 'auto';
|
// Setting height or width to number like 100.00000005 won't work (it will be truncated).
|
||||||
this.editorDom.style.height = size.height + 'px';
|
// Unfortunately ace editor will do the same math we do, and will expect the height or width
|
||||||
|
// of the container to be 100.0000005, and when it finds out that it is only 100px will show
|
||||||
|
// scrollbars. To fix this issue we will make the container a little bit bigger.
|
||||||
|
// This won't help for zooming (where the same problem occurs but in many more places), but will
|
||||||
|
// help for Windows users who have different pixel ratio.
|
||||||
|
this.editorDom.style.width = size.width ? Math.ceil(size.width) + 'px' : 'auto';
|
||||||
|
this.editorDom.style.height = Math.ceil(size.height) + 'px';
|
||||||
this.editor.resize();
|
this.editor.resize();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,10 +33,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Make overflow hidden, since editor might be 1 pixel bigger due to fix for devices
|
||||||
|
* with different pixel ratio */
|
||||||
.formula_editor {
|
.formula_editor {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 4px 0 2px 21px;
|
padding: 4px 0 2px 21px;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* styles specific to the formula editor in the side panel */
|
/* styles specific to the formula editor in the side panel */
|
||||||
|
Loading…
Reference in New Issue
Block a user