Skip to content

Commit 23da8ac

Browse files
authored
fix(ComboBox): Add missing onSelectionChange event prop (#1399)
1 parent b79ac66 commit 23da8ac

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/main/scripts/create-web-components-wrapper.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const prettierConfig = {
2727
};
2828

2929
const WEB_COMPONENTS_ROOT_DIR = path.join(PATHS.packages, 'main', 'src', 'webComponents');
30-
const LIB_DIR = path.join(PATHS.packages, 'main', 'src', 'lib');
30+
const DIST_DIR = path.join(PATHS.packages, 'main', 'src', 'dist');
3131

3232
const KNOWN_EVENTS = new Set(['click', 'input', 'submit', 'change', 'select', 'drop']);
3333

@@ -1028,7 +1028,7 @@ resolvedWebComponents.forEach((componentSpec) => {
10281028
export type { ${componentSpec.module}PropTypes };`,
10291029
prettierConfig
10301030
);
1031-
fs.writeFileSync(path.join(LIB_DIR, `${componentSpec.module}.ts`), libContent);
1031+
fs.writeFileSync(path.join(DIST_DIR, `${componentSpec.module}.ts`), libContent);
10321032

10331033
// create test
10341034
if (!fs.existsSync(path.join(webComponentFolderPath, `${componentSpec.module}.test.tsx`))) {

packages/main/src/webComponents/ComboBox/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ export interface ComboBoxPropTypes extends Omit<WithWebComponentPropTypes, 'onCh
9898
* **Note:** filterValue property is updated, input is changed.
9999
*/
100100
onInput?: (event: CustomEvent) => void;
101+
/**
102+
* Fired when the selection has changed via user interaction
103+
*/
104+
onSelectionChange?: (event: CustomEvent<{ item: ReactNode }>) => void;
101105
}
102106

103107
/**
@@ -110,7 +114,7 @@ const ComboBox: FC<ComboBoxPropTypes> = withWebComponent<ComboBoxPropTypes>(
110114
['filter', 'filterValue', 'placeholder', 'value', 'valueState'],
111115
['disabled', 'loading', 'readonly', 'required'],
112116
['icon', 'valueStateMessage'],
113-
['change', 'input']
117+
['change', 'input', 'selection-change']
114118
);
115119

116120
ComboBox.displayName = 'ComboBox';

0 commit comments

Comments
 (0)