Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3632 - issue fix #3634

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api-generator/components/column.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ const ColumnProps = [
default: 'true',
description: 'When enabled, a button is displayed to add more rules.'
},
{
name: 'autoFocus',
type: 'boolean',
default: 'true',
description: 'When enabled, filter opens and the first element will focus.'
},
{
name: 'filterMatchModeOptions',
type: 'array',
Expand Down
5 changes: 5 additions & 0 deletions components/column/Column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ export interface ColumnProps {
* Default value is true.
*/
showAddButton?: boolean | undefined;
/**
* When enabled, filter opens and the first element will focus.
* Default value is true.
*/
autoFocus?: boolean | undefined;
/**
* An array of label-value pairs to override the global match mode options.
*/
Expand Down
4 changes: 4 additions & 0 deletions components/column/Column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export default {
type: Boolean,
default: true
},
autoFocus: {
type: Boolean,
default: true
},
filterMatchModeOptions: {
type: Array,
default: null
Expand Down
9 changes: 7 additions & 2 deletions components/datatable/ColumnFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
v-if="overlayVisible"
:ref="overlayRef"
:id="overlayId"
v-focustrap="{ autoFocus: true }"
v-focustrap="{ autoFocus: focustrapAutoFocus }"
:aria-modal="overlayVisible"
role="dialog"
:class="overlayClass"
Expand Down Expand Up @@ -145,6 +145,10 @@ export default {
type: Boolean,
default: true
},
autoFocus: {
type: Boolean,
default: true
},
showClearButton: {
type: Boolean,
default: true
Expand Down Expand Up @@ -199,7 +203,8 @@ export default {
return {
overlayVisible: false,
defaultMatchMode: null,
defaultOperator: null
defaultOperator: null,
focustrapAutoFocus: this.autoFocus
};
},
overlay: null,
Expand Down
1 change: 1 addition & 0 deletions components/datatable/HeaderCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
:showApplyButton="columnProp('showApplyButton')"
:showMatchModes="columnProp('showFilterMatchModes')"
:showAddButton="columnProp('showAddButton')"
:autoFocus="columnProp('autoFocus')"
:matchModeOptions="columnProp('filterMatchModeOptions')"
:maxConstraints="columnProp('maxConstraints')"
@operator-change="$emit('operator-change', $event)"
Expand Down
1 change: 1 addition & 0 deletions components/datatable/TableHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
:showApplyButton="columnProp(col, 'showApplyButton')"
:showMatchModes="columnProp(col, 'showFilterMatchModes')"
:showAddButton="columnProp(col, 'showAddButton')"
:autoFocus="columnProp(col, 'autoFocus')"
:matchModeOptions="columnProp(col, 'filterMatchModeOptions')"
:maxConstraints="columnProp(col, 'maxConstraints')"
@operator-change="$emit('operator-change', $event)"
Expand Down
6 changes: 6 additions & 0 deletions pages/datatable/DataTableDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ export default {
<td>true</td>
<td>When enabled, a button is displayed to add more rules.</td>
</tr>
<tr>
<td>autoFocus</td>
<td>boolean</td>
<td>true</td>
<td>When enabled, filter opens and the first element will focus.</td>
</tr>
<tr>
<td>filterMatchModeOptions</td>
<td>array</td>
Expand Down