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
This commit is contained in:
Yohan Boniface 2024-07-10 11:21:51 +02:00
parent 3fb7be28ec
commit 9f04f56c7c
2 changed files with 6 additions and 4 deletions

View file

@ -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);

View file

@ -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())