Skip to content

Commit

Permalink
wip: use position: fixed for input/textarea in tableeditor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yohanboniface committed Jul 10, 2024
1 parent 8731707 commit 273ed73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions umap/static/umap/css/tableeditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@
.umap-table-editor .formbox,
.umap-table-editor input {
margin: 0;
min-height: initial;
}
.umap-table-editor textarea,
.umap-table-editor input {
border-radius: initial;
width: initial;
position: fixed;
}
.umap-table-editor th button {
transform: rotate(90deg);
Expand Down
4 changes: 1 addition & 3 deletions umap/static/umap/js/modules/tableeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 273ed73

Please sign in to comment.