mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Fix for onSelect event of dropdowns (#722)
* onSelect event for dropdown * onSelect should be fired after state change
This commit is contained in:
parent
268167a86d
commit
0cbc250689
2 changed files with 4 additions and 3 deletions
|
|
@ -9,7 +9,8 @@ export const DropDown = function DropDown({
|
|||
component,
|
||||
onComponentClick,
|
||||
currentState,
|
||||
onComponentOptionChanged
|
||||
onComponentOptionChanged,
|
||||
onEvent
|
||||
}) {
|
||||
console.log('currentState', currentState);
|
||||
|
||||
|
|
@ -78,7 +79,7 @@ export const DropDown = function DropDown({
|
|||
}, [newValue]);
|
||||
|
||||
useEffect(() => {
|
||||
onComponentOptionChanged(component, 'value', currentValue);
|
||||
onComponentOptionChanged(component, 'value', currentValue).then(() => onEvent('onSelect', { component }) );
|
||||
}, [currentValue]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ export async function onEvent(_ref, eventName, options, mode = 'edit') {
|
|||
});
|
||||
}
|
||||
|
||||
if (['onDetect', 'onCheck', 'onUnCheck', 'onBoundsChange', 'onCreateMarker', 'onMarkerClick', 'onPageChanged', 'onSearch', 'onChange', 'onSelectionChange'].includes(eventName)) {
|
||||
if (['onDetect', 'onCheck', 'onUnCheck', 'onBoundsChange', 'onCreateMarker', 'onMarkerClick', 'onPageChanged', 'onSearch', 'onChange', 'onSelectionChange', 'onSelect'].includes(eventName)) {
|
||||
const { component } = options;
|
||||
executeActionsForEventId(_ref, eventName, component, mode);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue