Skip to content

Commit

Permalink
FIO-9245 DataGrid: Fix width and positioning for table buttons (#118)
Browse files Browse the repository at this point in the history
- Remove col-1 bootstrap class, which causes the button to expand to a large width in certain cases
- Reverts 3dde49a#diff-d4f4129fd92b63c9446af2cf9a7d3d15b45cfbfc8b7adb61b131e5c8c1227bdf
  • Loading branch information
blakekrammes authored Dec 11, 2024
1 parent 8cf5ef5 commit 2cdc27c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/templates/bootstrap4/datagrid/form.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
{% } %}
<tr ref="{{ctx.datagridKey}}-row">
{% if (ctx.component.reorder) { %}
<td class="col-1">
<button type="button" class="formio-drag-button btn btn-default fa fa-bars" data-key="{{ctx.datagridKey}}"></button>
<td>
<button type="button" class="formio-drag-button btn btn-default fa fa-bars" data-key="{{ctx.datagridKey}}" style="display: block; margin: 0 auto"></button>
</td>
{% } %}
{% ctx.columns.forEach(function(col) { %}
Expand All @@ -49,8 +49,8 @@
{% }) %}
{% if (ctx.hasExtraColumn) { %}
{% if (ctx.hasRemoveButtons) { %}
<td class="col-1">
<button type="button" class="btn btn-secondary formio-button-remove-row" ref="{{ctx.datagridKey}}-removeRow" tabindex="{{ctx.tabIndex}}" aria-label="{{ctx.t('remove')}}">
<td>
<button type="button" class="btn btn-secondary formio-button-remove-row" ref="{{ctx.datagridKey}}-removeRow" tabindex="{{ctx.tabIndex}}" aria-label="{{ctx.t('remove')}}" style="display: block; margin: 0 auto">
<i class="{{ctx.iconClass('remove-circle')}}"></i>
</button>
</td>
Expand Down
8 changes: 4 additions & 4 deletions src/templates/bootstrap5/datagrid/form.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
{% } %}
<tr ref="{{ctx.datagridKey}}-row">
{% if (ctx.component.reorder) { %}
<td class="col-1">
<button type="button" class="formio-drag-button btn btn-default bi bi-list" data-key="{{ctx.datagridKey}}"></button>
<td>
<button type="button" class="formio-drag-button btn btn-default bi bi-list" data-key="{{ctx.datagridKey}}" style="display: block; margin: 0 auto"></button>
</td>
{% } %}
{% ctx.columns.forEach(function(col) { %}
Expand All @@ -49,8 +49,8 @@
{% }) %}
{% if (ctx.hasExtraColumn) { %}
{% if (ctx.hasRemoveButtons) { %}
<td class="col-1">
<button type="button" class="btn btn-secondary formio-button-remove-row" ref="{{ctx.datagridKey}}-removeRow" tabindex="{{ctx.tabIndex}}" aria-label="{{ctx.t('remove')}}">
<td>
<button type="button" class="btn btn-secondary formio-button-remove-row" ref="{{ctx.datagridKey}}-removeRow" tabindex="{{ctx.tabIndex}}" aria-label="{{ctx.t('remove')}}" style="display: block; margin: 0 auto">
<i class="{{ctx.iconClass('remove-circle')}}"></i>
</button>
</td>
Expand Down

0 comments on commit 2cdc27c

Please sign in to comment.