@lumx/react 4.9.0-next.16 → 4.9.0-next.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -0
- package/index.js +22 -10
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1889,6 +1889,7 @@ interface RawInputTextProps$1 extends HasTheme, HasClassName {
|
|
|
1889
1889
|
name?: string | undefined;
|
|
1890
1890
|
ref?: CommonRef;
|
|
1891
1891
|
handleChange?: (value: string, name?: string, event?: any) => void;
|
|
1892
|
+
handleInput?: (value: string, name?: string, event?: any) => void;
|
|
1892
1893
|
}
|
|
1893
1894
|
|
|
1894
1895
|
type NativeInputProps = Omit<ComponentProps<'input'>, 'value' | 'onChange'>;
|
|
@@ -1914,6 +1915,7 @@ interface RawInputTextareaProps$1 extends HasTheme, HasClassName {
|
|
|
1914
1915
|
name?: string | undefined;
|
|
1915
1916
|
ref?: CommonRef;
|
|
1916
1917
|
handleChange?: (value: string, name?: string, event?: any) => void;
|
|
1918
|
+
handleInput?: (value: string, name?: string, event?: any) => void;
|
|
1917
1919
|
}
|
|
1918
1920
|
|
|
1919
1921
|
type NativeTextareaProps = Omit<ComponentProps<'textarea'>, 'value' | 'onChange'>;
|
package/index.js
CHANGED
|
@@ -2498,7 +2498,8 @@ function isOptionDisabled(option) {
|
|
|
2498
2498
|
/** Returns true when the cell is NOT the first gridcell in its row (i.e., it's an action cell). */
|
|
2499
2499
|
function isActionCell(cell) {
|
|
2500
2500
|
const row = cell.closest('[role="row"]');
|
|
2501
|
-
|
|
2501
|
+
if (!row) return false;
|
|
2502
|
+
return row.querySelector('[role="gridcell"]') !== cell;
|
|
2502
2503
|
}
|
|
2503
2504
|
|
|
2504
2505
|
/** Predicate matching an option element that carries `aria-selected="true"`. */
|
|
@@ -3371,16 +3372,17 @@ function setupCombobox(callbacks, options, onTriggerAttach) {
|
|
|
3371
3372
|
switch (event.key) {
|
|
3372
3373
|
case 'Enter':
|
|
3373
3374
|
if (handle.isOpen && nav?.hasActiveItem && nav.activeItem) {
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3375
|
+
// Capture activeItem before click — the click handler may close
|
|
3376
|
+
// the popover and clear the focus navigation state.
|
|
3377
|
+
const {
|
|
3378
|
+
activeItem
|
|
3379
|
+
} = nav;
|
|
3380
|
+
// "Click" on active option
|
|
3381
|
+
if (!isOptionDisabled(activeItem)) {
|
|
3382
|
+
activeItem.click();
|
|
3379
3383
|
}
|
|
3380
|
-
//
|
|
3381
|
-
|
|
3382
|
-
// and disabled options, the delegated handler did NOT close, so this is needed.
|
|
3383
|
-
if (!handle.isMultiSelect) {
|
|
3384
|
+
// Only close when not in multi select and not in action cell
|
|
3385
|
+
if (!handle.isMultiSelect && !isActionCell(activeItem)) {
|
|
3384
3386
|
handle.setIsOpen(false);
|
|
3385
3387
|
}
|
|
3386
3388
|
} else if (!handle.isMultiSelect) {
|
|
@@ -7014,6 +7016,7 @@ const RawInputText$1 = props => {
|
|
|
7014
7016
|
theme,
|
|
7015
7017
|
value,
|
|
7016
7018
|
handleChange,
|
|
7019
|
+
handleInput,
|
|
7017
7020
|
type = DEFAULT_PROPS$10.type,
|
|
7018
7021
|
name,
|
|
7019
7022
|
ref,
|
|
@@ -7022,6 +7025,9 @@ const RawInputText$1 = props => {
|
|
|
7022
7025
|
const handleOnChange = evt => {
|
|
7023
7026
|
handleChange?.(evt.target.value, name, evt);
|
|
7024
7027
|
};
|
|
7028
|
+
const handleOnInput = evt => {
|
|
7029
|
+
handleInput?.(evt.target.value, name, evt);
|
|
7030
|
+
};
|
|
7025
7031
|
return /*#__PURE__*/jsx("input", {
|
|
7026
7032
|
...forwardedProps,
|
|
7027
7033
|
name: name,
|
|
@@ -7032,6 +7038,7 @@ const RawInputText$1 = props => {
|
|
|
7032
7038
|
text: true
|
|
7033
7039
|
})),
|
|
7034
7040
|
onChange: handleOnChange,
|
|
7041
|
+
onInput: handleOnInput,
|
|
7035
7042
|
value: value
|
|
7036
7043
|
});
|
|
7037
7044
|
};
|
|
@@ -7080,6 +7087,7 @@ const RawInputTextarea$1 = props => {
|
|
|
7080
7087
|
theme,
|
|
7081
7088
|
value,
|
|
7082
7089
|
handleChange,
|
|
7090
|
+
handleInput,
|
|
7083
7091
|
rows = DEFAULT_PROPS$$.rows,
|
|
7084
7092
|
name,
|
|
7085
7093
|
ref,
|
|
@@ -7088,6 +7096,9 @@ const RawInputTextarea$1 = props => {
|
|
|
7088
7096
|
const handleOnChange = evt => {
|
|
7089
7097
|
handleChange?.(evt.target.value, name, evt);
|
|
7090
7098
|
};
|
|
7099
|
+
const handleOnInput = evt => {
|
|
7100
|
+
handleInput?.(evt.target.value, name, evt);
|
|
7101
|
+
};
|
|
7091
7102
|
return /*#__PURE__*/jsx("textarea", {
|
|
7092
7103
|
...forwardedProps,
|
|
7093
7104
|
name: name,
|
|
@@ -7097,6 +7108,7 @@ const RawInputTextarea$1 = props => {
|
|
|
7097
7108
|
textarea: true
|
|
7098
7109
|
})),
|
|
7099
7110
|
onChange: handleOnChange,
|
|
7111
|
+
onInput: handleOnInput,
|
|
7100
7112
|
value: value,
|
|
7101
7113
|
rows: rows
|
|
7102
7114
|
});
|