cluk3 / cluk3/use-context-menu

context-menu appear on the left of the window when i'm closing it

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
36
Forks
3
PR merge metrics
No merged PRs in 30d

Description

- `react-use-context-menu` version: 0.1.4
- `node` version: 12.18.2
- `yarn` version: 1.22

What you did:
i have a project which render a document list and i use context-menu on its elements.

What happened:
when i close the context menu with a left click, the context-menu closes and reappear during 1 frame on the left side of the viewport.

unfortunately, i can't reproduce it on codesandbox

Problem description:
on /useContextMenu.js, the `setStyles(baseStyles)` doesn't keep the top and left position of the context-menu before disappearing

Suggested solution:
replace it with
```
setStyles({ ...style, position: 'fixed', opacity: 0, pointerEvents: 'none' });
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open /useContextMenu.js and inspect how the menu styles are reset when a left click closes it. Reproduce the close interaction with a document-list context menu and verify that the menu does not briefly reappear at the viewport's left edge while retaining its previous position.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.