material-react-table-narender 2.13.18 → 2.13.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.esm.js +36 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +36 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/cell.utils.ts +26 -9
package/package.json
CHANGED
package/src/utils/cell.utils.ts
CHANGED
@@ -96,16 +96,33 @@ if (event.altKey) {
|
|
96
96
|
const currentCell = event.currentTarget;
|
97
97
|
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
99
|
+
if (enableKeyboardShortcuts) {
|
100
|
+
const input = currentCell.querySelector('input') as HTMLInputElement;
|
101
|
+
const select = currentCell.querySelector('select') as HTMLSelectElement;
|
102
|
+
const checkbox = currentCell.querySelector('input[type="checkbox"]') as HTMLInputElement;
|
103
|
+
const button = currentCell.querySelector('button') as HTMLButtonElement;
|
104
|
+
const autocomplete = currentCell.querySelector('.MuiAutocomplete-root input[type="text"]') as HTMLInputElement;
|
105
|
+
|
106
|
+
|
107
|
+
if (autocomplete) {
|
108
|
+
autocomplete.focus();
|
109
|
+
autocomplete.select?.();
|
110
|
+
} else if (input) {
|
111
|
+
input.focus();
|
112
|
+
input.select?.();
|
113
|
+
} else if (select) {
|
114
|
+
select.focus();
|
115
|
+
} else if (checkbox) {
|
116
|
+
checkbox.focus();
|
117
|
+
// checkbox.click();
|
118
|
+
} else if (button) {
|
119
|
+
button.focus();
|
120
|
+
} else {
|
121
|
+
currentCell.focus();
|
108
122
|
}
|
123
|
+
}
|
124
|
+
|
125
|
+
}
|
109
126
|
|
110
127
|
// if (!table.options.enableKeyboardShortcuts) return;
|
111
128
|
if (!enableKeyboardShortcuts) return
|