mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-04 11:35:02 -05:00
fix(ui): do not zoom when double clicking switch
This commit is contained in:
committed by
Kent Keirsey
parent
e81ef0a090
commit
55aee034b0
@@ -1,7 +1,7 @@
|
||||
import { Switch } from '@invoke-ai/ui-library';
|
||||
import { useAppDispatch } from 'app/store/storeHooks';
|
||||
import { fieldBooleanValueChanged } from 'features/nodes/store/nodesSlice';
|
||||
import { NO_DRAG_CLASS } from 'features/nodes/types/constants';
|
||||
import { NO_DRAG_CLASS, NO_FIT_ON_DOUBLE_CLICK_CLASS } from 'features/nodes/types/constants';
|
||||
import type { BooleanFieldInputInstance, BooleanFieldInputTemplate } from 'features/nodes/types/field';
|
||||
import type { ChangeEvent } from 'react';
|
||||
import { memo, useCallback } from 'react';
|
||||
@@ -28,7 +28,13 @@ const BooleanFieldInputComponent = (
|
||||
[dispatch, field.name, nodeId]
|
||||
);
|
||||
|
||||
return <Switch className={NO_DRAG_CLASS} onChange={handleValueChanged} isChecked={field.value} />;
|
||||
return (
|
||||
<Switch
|
||||
className={`${NO_DRAG_CLASS} ${NO_FIT_ON_DOUBLE_CLICK_CLASS}`}
|
||||
onChange={handleValueChanged}
|
||||
isChecked={field.value}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default memo(BooleanFieldInputComponent);
|
||||
|
||||
Reference in New Issue
Block a user