diff --git a/package-lock.json b/package-lock.json index ff7cc79af..c8c09c5a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,12 +6,12 @@ "packages": { "": { "name": "tabulator-tables", - "version": "6.3.1", + "version": "6.4.0", "license": "MIT", "devDependencies": { "@babel/core": "^7.26.9", "@babel/preset-env": "^7.26.9", - "@playwright/test": "^1.50.1", + "@playwright/test": "^1.60.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-terser": "^0.4.4", "@types/node": "^22.13.5", @@ -2733,13 +2733,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.55.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.1.tgz", - "integrity": "sha512-IVAh/nOJaw6W9g+RJVlIQJ6gSiER+ae6mKQ5CX1bERzQgbC1VSeBlwdvczT7pxb0GWiyrxH4TGKbMfDb4Sq/ig==", + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.60.0.tgz", + "integrity": "sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.55.1" + "playwright": "1.60.0" }, "bin": { "playwright": "cli.js" @@ -7305,13 +7305,13 @@ } }, "node_modules/playwright": { - "version": "1.55.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.1.tgz", - "integrity": "sha512-cJW4Xd/G3v5ovXtJJ52MAOclqeac9S/aGGgRzLabuF8TnIb6xHvMzKIa6JmrRzUkeXJgfL1MhukP0NK6l39h3A==", + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.60.0.tgz", + "integrity": "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.55.1" + "playwright-core": "1.60.0" }, "bin": { "playwright": "cli.js" @@ -7324,9 +7324,9 @@ } }, "node_modules/playwright-core": { - "version": "1.55.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.1.tgz", - "integrity": "sha512-Z6Mh9mkwX+zxSlHqdr5AOcJnfp+xUWLCt9uKV18fhzA8eyxUd8NUWzAjxUh55RZKSYwDGX0cfaySdhZJGMoJ+w==", + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.60.0.tgz", + "integrity": "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index a025d01c0..06408551a 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "devDependencies": { "@babel/core": "^7.26.9", "@babel/preset-env": "^7.26.9", - "@playwright/test": "^1.50.1", + "@playwright/test": "^1.60.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-terser": "^0.4.4", "@types/node": "^22.13.5", diff --git a/src/js/core/CoreFeature.js b/src/js/core/CoreFeature.js index 7e19be5d8..89253f986 100644 --- a/src/js/core/CoreFeature.js +++ b/src/js/core/CoreFeature.js @@ -45,6 +45,7 @@ export default class CoreFeature{ //////////////// Layout ///////////////// ////////////////////////////////////////// + /** @returns {("fitData" | "fitDataFill" | "fitDataTable" | "fitDataStretch" | "fitColumns")} */ layoutMode(){ return this.table.modules.layout.getMode(); } diff --git a/src/js/core/tools/Popup.js b/src/js/core/tools/Popup.js index d2ec9b3f4..796a51b7b 100644 --- a/src/js/core/tools/Popup.js +++ b/src/js/core/tools/Popup.js @@ -203,13 +203,23 @@ export default class Popup extends CoreFeature{ case "bottom": this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + "px"; break; - + default: this.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + "px"; } - + }else{ - this.element.style.height = offsetHeight + "px"; + let menuHeight = this.element.offsetHeight; + if(menuHeight > offsetHeight){ + this.element.style.top = "0px"; + this.element.style.height = offsetHeight + "px"; + }else{ + let newTop = y - menuHeight; + if(newTop < 0){ + newTop = offsetHeight - menuHeight; + } + this.element.style.top = newTop + "px"; + } } } } diff --git a/src/js/modules/GroupRows/Group.js b/src/js/modules/GroupRows/Group.js index db1b86f99..c152f3f59 100644 --- a/src/js/modules/GroupRows/Group.js +++ b/src/js/modules/GroupRows/Group.js @@ -592,7 +592,9 @@ export default class Group{ reinitializeHeight(){} - calcHeight(){} + calcHeight(){ + this.outerHeight = this.element.offsetHeight; + } setCellHeight(){} diff --git a/src/js/modules/GroupRows/GroupRows.js b/src/js/modules/GroupRows/GroupRows.js index 2b50a5884..8e65ac229 100644 --- a/src/js/modules/GroupRows/GroupRows.js +++ b/src/js/modules/GroupRows/GroupRows.js @@ -70,6 +70,7 @@ export default class GroupRows extends Module{ this.subscribe("rows-sample", this.rowSample.bind(this)); this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this)); + this.subscribe("table-layout", this.virtualRenderFill.bind(this)); this.registerDisplayHandler(this.displayHandler, 20); @@ -191,17 +192,14 @@ export default class GroupRows extends Module{ } virtualRenderFill(){ - var el = this.table.rowManager.tableElement; - var rows = this.table.rowManager.getVisibleRows(); - - if(this.table.options.groupBy){ - rows = rows.filter((row) => { - return row.type !== "group"; - }); - - el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : ""; - }else{ - return rows; + const layout = this.layoutMode(); + if ( + layout === "fitDataFill" + || layout === "fitDataStretch" + || layout === "fitColumns" + ) { + this.table.rowManager.tableElement.style.minWidth = + this.table.columnManager.getWidth() + "px"; } } diff --git a/test/e2e/group-scroll.html b/test/e2e/group-scroll.html new file mode 100644 index 000000000..aed821ead --- /dev/null +++ b/test/e2e/group-scroll.html @@ -0,0 +1,55 @@ + + +
+ +