fix:网页面板下,右侧pin的面板拖拽事件丢失问题 || fix: Under the web page panel, the panel drag event on the right pin is lost#146
fix:网页面板下,右侧pin的面板拖拽事件丢失问题 || fix: Under the web page panel, the panel drag event on the right pin is lost#146oathll wants to merge 1 commit intomsgbyte:masterfrom
Conversation
| }); | ||
|
|
||
| export const dragActions = globalSlice.actions; | ||
| export const dragReducer = globalSlice.reducer; |
There was a problem hiding this comment.
Its looks like should not create a new slice and should merge into uiSlice.
| } | ||
|
|
||
| const initialState: DragState = { | ||
| isDraging: false, |
There was a problem hiding this comment.
Its should be isDragging
| @@ -0,0 +1,27 @@ | |||
| import { useAppSelector ,useAppDispatch} from './useAppSelector'; | |||
| import {dragActions} from '../slices/drag' | |||
There was a problem hiding this comment.
Why your code not auto format? did you skip github hooks manual?
| const ref = useRef<HTMLIFrameElement>(null); | ||
| const [spinning, setSpinning] = useState(true); | ||
|
|
||
| const status = useDragstatus() |
There was a problem hiding this comment.
An important problem is component Webview is a pure component and should not dependency with redux. redux has a scope in main route, the other route not use redux anywhere and not need it.
This code will restrict this component must be render under redux context.
My suggestion is change pin logic, and overlay a translucent div on both sides of the drag bar. To make sure drag event not send into iframe
| * 更新 | ||
| */ | ||
| const updateStatus= useMemoizedFn((status: boolean) => { | ||
| setStatus(status); |
There was a problem hiding this comment.
you can direct call dispatch(dragActions.setDragStatus(status)). and suggest replace useMemoizedFn with useEvent
undefined
null