Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:网页面板下,右侧pin的面板拖拽事件丢失问题 || fix: Under the web page panel, the panel drag event on the right pin is lost #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oathll
Copy link

@oathll oathll commented Aug 25, 2023

undefined


null

@github-actions github-actions bot changed the title fix:网页面板下,右侧pin的面板拖拽事件丢失问题 fix:网页面板下,右侧pin的面板拖拽事件丢失问题 || fix: Under the web page panel, the panel drag event on the right pin is lost Aug 25, 2023
});

export const dragActions = globalSlice.actions;
export const dragReducer = globalSlice.reducer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its looks like should not create a new slice and should merge into uiSlice.

}

const initialState: DragState = {
isDraging: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its should be isDragging

@@ -0,0 +1,27 @@
import { useAppSelector ,useAppDispatch} from './useAppSelector';
import {dragActions} from '../slices/drag'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why your code not auto format? did you skip github hooks manual?

@@ -15,25 +17,27 @@ interface WebviewProps {
export const Webview: React.FC<WebviewProps> = (props) => {
const ref = useRef<HTMLIFrameElement>(null);
const [spinning, setSpinning] = useState(true);

const status = useDragstatus()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can direct call dispatch(dragActions.setDragStatus(status)). and suggest replace useMemoizedFn with useEvent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants