Fixed #557: inner contents of the scrollable area being displayed outside of the editor (on Chrome only)

This commit is contained in:
jos 2018-07-28 15:29:34 +02:00
parent d05231977c
commit 91241c6684
3 changed files with 21 additions and 3 deletions

View File

@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor
## 2018-07-28, version 5.19.1
- Fixed #557: inner contents of the scrollable area being displayed outside of
the editor (on Chrome only).
## 2018-07-11, version 5.19.0
- No more grayed out icons of the context menu, see #532.

View File

@ -218,7 +218,10 @@ div.jsoneditor-tree table.jsoneditor-tree {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
margin: 0 0 300px; /* keep space for the action menu dropdown */
}
div.jsoneditor-tree div.jsoneditor-tree-inner {
padding-bottom: 300px;
}
div.jsoneditor-outer {

View File

@ -1331,9 +1331,18 @@ treemode._createTable = function () {
}
this.contentOuter = contentOuter;
this.scrollableContent = document.createElement('div');
this.scrollableContent.className = 'jsoneditor-tree';
contentOuter.appendChild(this.scrollableContent);
// the jsoneditor-tree-inner div with bottom padding is here to
// keep space for the action menu dropdown. It's created as a
// separate div instead of using scrollableContent to work around
// and issue in the Chrome browser showing scrollable contents outside of the div
// see https://github.com/josdejong/jsoneditor/issues/557
this.content = document.createElement('div');
this.content.className = 'jsoneditor-tree';
contentOuter.appendChild(this.content);
this.content.className = 'jsoneditor-tree-inner';
this.scrollableContent.appendChild(this.content);
this.table = document.createElement('table');
this.table.className = 'jsoneditor-tree';