mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2025-12-24 06:58:48 -05:00
feat: prevents user highlighting while dragging
This commit is contained in:
@@ -3,6 +3,12 @@ import { InteractionReducer } from 'src/types';
|
||||
|
||||
export const DragItems: InteractionReducer = {
|
||||
type: 'DRAG_ITEMS',
|
||||
entry: (draftState) => {
|
||||
draftState.rendererRef.style.userSelect = 'none';
|
||||
},
|
||||
exit: (draftState) => {
|
||||
draftState.rendererRef.style.userSelect = 'auto';
|
||||
},
|
||||
mousemove: (draftState) => {
|
||||
if (draftState.mode.type !== 'DRAG_ITEMS') return;
|
||||
|
||||
|
||||
@@ -87,7 +87,8 @@ export const useInteractionManager = () => {
|
||||
mode,
|
||||
scroll,
|
||||
contextMenu,
|
||||
itemControls
|
||||
itemControls,
|
||||
rendererRef: rendererRef.current
|
||||
};
|
||||
|
||||
const getTransitionaryState = () => {
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface State {
|
||||
scene: Scene;
|
||||
contextMenu: ContextMenu;
|
||||
itemControls: ItemControls;
|
||||
rendererRef: HTMLElement;
|
||||
}
|
||||
|
||||
export type InteractionReducerAction = (state: Draft<State>) => void;
|
||||
|
||||
Reference in New Issue
Block a user