mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix sizing of tracebacks in formula errors, to make it scrollable
Summary: When traceback is present, give it 64px, or more if available, or less if less is needed. If less space is available than needed, the traceback will scroll within its allocated area. Test Plan: The test FieldEditorSizing which tests basic sizing still passes; details with different size of formula and traceback were tested manually. Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3531
This commit is contained in:
@@ -234,11 +234,17 @@ AceEditor.prototype._setup = function() {
|
||||
AceEditor.prototype.resize = function() {
|
||||
var wrap = this.session.getUseWrapMode();
|
||||
var contentWidth = wrap ? 0 : this._getContentWidth();
|
||||
var contentHeight = this._getContentHeight();
|
||||
var desiredSize = {
|
||||
width: wrap ? 0 : contentWidth + this.textPadding,
|
||||
height: this._getContentHeight()
|
||||
height: contentHeight,
|
||||
};
|
||||
var size = this.calcSize(this._fullDom, desiredSize);
|
||||
if (size.height < contentHeight) {
|
||||
// Editor will show a vertical scrollbar, so recalculate to make space for it.
|
||||
desiredSize.width += 20;
|
||||
size = this.calcSize(this._fullDom, desiredSize);
|
||||
}
|
||||
if (size.width < contentWidth) {
|
||||
// Editor will show a horizontal scrollbar, so recalculate to make space for it.
|
||||
desiredSize.height += 20;
|
||||
|
||||
Reference in New Issue
Block a user