From 9f04f56c7cccf4b8e8941bc54a1c86318d53af79 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 10 Jul 2024 11:21:51 +0200 Subject: [PATCH] wip: use position: fixed for input/textarea in tableeditor so it does not increase the cell width and does not change all the table size. Actually, there is still a small size change as we remove the cell content before adding the input/textarea, but more subtle than before --- umap/static/umap/css/tableeditor.css | 6 +++++- umap/static/umap/js/modules/tableeditor.js | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/umap/static/umap/css/tableeditor.css b/umap/static/umap/css/tableeditor.css index 39a18777..b419bab2 100644 --- a/umap/static/umap/css/tableeditor.css +++ b/umap/static/umap/css/tableeditor.css @@ -70,9 +70,13 @@ .umap-table-editor .formbox, .umap-table-editor input { margin: 0; + min-height: initial; } -.umap-table-editor input { +.umap-table-editor textarea, +.umap-table-editor input[type=text] { border-radius: initial; + width: initial; + position: fixed; } .umap-table-editor th button { transform: rotate(90deg); diff --git a/umap/static/umap/js/modules/tableeditor.js b/umap/static/umap/js/modules/tableeditor.js index 622dee21..98deafc2 100644 --- a/umap/static/umap/js/modules/tableeditor.js +++ b/umap/static/umap/js/modules/tableeditor.js @@ -215,10 +215,8 @@ export default class TableEditor extends WithTemplate { const tr = event.target.closest('tr') const feature = this.datalayer.getFeatureById(tr.dataset.feature) const handler = property === 'description' ? 'Textarea' : 'Input' - const builder = new U.FormBuilder(feature, [[field, { handler: handler }]], { + const builder = new U.FormBuilder(feature, [[field, { handler }]], { id: `umap-feature-properties_${L.stamp(feature)}`, - className: 'trow', - callback: feature.resetTooltip, }) cell.innerHTML = '' cell.appendChild(builder.build())