@@ -126,49 +126,57 @@ export interface StrictDropdownProps {
126126 * Called when a user adds a new item. Use this to update the options list.
127127 *
128128 * @param {SyntheticEvent } event - React's original SyntheticEvent.
129- * @param {object } data - All props and the new item's value .
129+ * @param {object } props - All props.
130130 */
131- onAddItem ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
131+ onAddItem ?: (
132+ event : React . SyntheticEvent < HTMLElement > ,
133+ props : DropdownProps ,
134+ value : boolean | number | string | ( boolean | number | string ) [ ] ,
135+ ) => void
132136
133137 /**
134138 * Called on blur.
135139 *
136140 * @param {SyntheticEvent } event - React's original SyntheticEvent.
137- * @param {object } data - All props.
141+ * @param {object } props - All props.
138142 */
139- onBlur ?: ( event : React . FocusEvent < HTMLElement > , data : DropdownProps ) => void
143+ onBlur ?: ( event : React . FocusEvent < HTMLElement > , props : DropdownProps ) => void
140144
141145 /**
142146 * Called when the user attempts to change the value.
143147 *
144148 * @param {SyntheticEvent } event - React's original SyntheticEvent.
145- * @param {object } data - All props and proposed value .
149+ * @param {object } props - All props.
146150 */
147- onChange ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
151+ onChange ?: (
152+ event : React . SyntheticEvent < HTMLElement > ,
153+ props : DropdownProps ,
154+ value : boolean | number | string | ( boolean | number | string ) [ ] ,
155+ ) => void
148156
149157 /**
150158 * Called on click.
151159 *
152160 * @param {SyntheticEvent } event - React's original SyntheticEvent.
153- * @param {object } data - All props.
161+ * @param {object } props - All props.
154162 */
155- onClick ?: ( event : React . MouseEvent < HTMLElement > , data : DropdownProps ) => void
163+ onClick ?: ( event : React . MouseEvent < HTMLElement > , props : DropdownProps ) => void
156164
157165 /**
158166 * Called when a close event happens.
159167 *
160168 * @param {SyntheticEvent } event - React's original SyntheticEvent.
161- * @param {object } data - All props.
169+ * @param {object } props - All props.
162170 */
163- onClose ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
171+ onClose ?: ( event : React . SyntheticEvent < HTMLElement > , props : DropdownProps ) => void
164172
165173 /**
166174 * Called on focus.
167175 *
168176 * @param {SyntheticEvent } event - React's original SyntheticEvent.
169- * @param {object } data - All props.
177+ * @param {object } props - All props.
170178 */
171- onFocus ?: ( event : React . FocusEvent < HTMLElement > , data : DropdownProps ) => void
179+ onFocus ?: ( event : React . FocusEvent < HTMLElement > , props : DropdownProps ) => void
172180
173181 /**
174182 * Called when a multi-select label is clicked.
@@ -182,27 +190,29 @@ export interface StrictDropdownProps {
182190 * Called on mousedown.
183191 *
184192 * @param {SyntheticEvent } event - React's original SyntheticEvent.
185- * @param {object } data - All props.
193+ * @param {object } props - All props.
186194 */
187- onMouseDown ?: ( event : React . MouseEvent < HTMLElement > , data : DropdownProps ) => void
195+ onMouseDown ?: ( event : React . MouseEvent < HTMLElement > , props : DropdownProps ) => void
188196
189197 /**
190198 * Called when an open event happens.
191199 *
192200 * @param {SyntheticEvent } event - React's original SyntheticEvent.
193- * @param {object } data - All props.
201+ * @param {object } props - All props.
194202 */
195- onOpen ?: ( event : React . SyntheticEvent < HTMLElement > , data : DropdownProps ) => void
203+ onOpen ?: ( event : React . SyntheticEvent < HTMLElement > , props : DropdownProps ) => void
196204
197205 /**
198206 * Called on search input change.
199207 *
200208 * @param {SyntheticEvent } event - React's original SyntheticEvent.
201- * @param {object } data - All props, includes current value of searchQuery.
209+ * @param {object } props - All props.
210+ * @param {string } searchQuery - Current value of searchQuery.
202211 */
203212 onSearchChange ?: (
204213 event : React . SyntheticEvent < HTMLElement > ,
205- data : DropdownOnSearchChangeData ,
214+ data : DropdownProps ,
215+ searchQuery : string ,
206216 ) => void
207217
208218 /** Controls whether or not the dropdown menu is displayed. */
@@ -292,13 +302,6 @@ export interface StrictDropdownProps {
292302 wrapSelection ?: boolean
293303}
294304
295- /* TODO: replace with DropdownProps when #1829 will be fixed:
296- * https://github.com/Semantic-Org/Semantic-UI-React/issues/1829
297- */
298- export interface DropdownOnSearchChangeData extends DropdownProps {
299- searchQuery : string
300- }
301-
302305declare const Dropdown : ForwardRefComponent < DropdownProps , HTMLDivElement > & {
303306 Divider : typeof DropdownDivider
304307 Header : typeof DropdownHeader
0 commit comments