Skip to content

Conversation

@Abrar74774
Copy link
Contributor

So, apparently previously the positioning of the context menu was set on the MUI Menu component itself in ContextMenu.tsx. I'm still not sure why this works perfectly on the default view area, but breaks after panning away. My guess is that it has something to do with MUI Menu's internal workings.

I looked up the MUI Menu docs, and it felt like we're supposed to position the anchor element (Menu components anchorEl) according to what we need instead of the Menu component, and then MUI will take care of positioning the Menu component. Ofcourse the docs dont explicitly say this, but using browser devtools you'll notice that the context menu element is positioned (using custom css top and left values) by MUI internally, regardless of if you've applied positioning on the Menu component or not.

So this is basically what I did: migrate the positoning logic and apply it to the anchor element. I've also changed the opening and closing logic by following how the docs did it, otherwise the context menu position seems to glitch while opening.

From my testing, it seems to work perfectly, i.e. context menu appears right on the tile clicked on regardless of how much you panned.

So a relatively simple fix, but took me a WHILE to figure all this out 🙂.

@stan-smith
Copy link
Owner

Legend! This one has been bugging me for ages!
I'll have a look later today if I get a chance ❤️
Stan

@stan-smith stan-smith merged commit fa5478e into stan-smith:master Jan 3, 2026
3 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 3, 2026
## [1.7.0](v1.6.1...v1.7.0) (2026-01-03)

### Features

* read-only mode ([#168](#168)) ([85d32e6](85d32e6))
* transparent background for exporting as png ([#180](#180)) @F4tal1t thank you for contributing as always! ([ba1b376](ba1b376))
* **ui:** enhance custom color picker and fix docs ([#169](#169)) thank you [@non-stop-dev](https://github.com/non-stop-dev) ([f56812c](f56812c))

### Bug Fixes

* resolve issue [#136](#136) where "Add Node" popup has huge offset ([#195](#195)) ([fa5478e](fa5478e))
github-actions bot pushed a commit that referenced this pull request Jan 6, 2026
## [1.7.0](v1.6.1...v1.7.0) (2026-01-06)

### Features

* read-only mode ([#168](#168)) ([85d32e6](85d32e6))
* transparent background for exporting as png ([#180](#180)) @F4tal1t thank you for contributing as always! ([ba1b376](ba1b376))
* **ui:** enhance custom color picker and fix docs ([#169](#169)) thank you [@non-stop-dev](https://github.com/non-stop-dev) ([f56812c](f56812c))

### Bug Fixes

* resolve issue [#136](#136) where "Add Node" popup has huge offset ([#195](#195)) ([fa5478e](fa5478e))

### Documentation

* fix remaining CONTRIBUTING.md links in readme ([#197](#197)) @Abrar74774 Thank you! ([cbf922d](cbf922d))
github-actions bot pushed a commit that referenced this pull request Jan 8, 2026
## [1.7.0](v1.6.1...v1.7.0) (2026-01-08)

### Features

* read-only mode ([#168](#168)) ([85d32e6](85d32e6))
* transparent background for exporting as png ([#180](#180)) @F4tal1t thank you for contributing as always! ([ba1b376](ba1b376))
* **ui:** enhance custom color picker and fix docs ([#169](#169)) thank you [@non-stop-dev](https://github.com/non-stop-dev) ([f56812c](f56812c))

### Bug Fixes

* resolve issue [#136](#136) where "Add Node" popup has huge offset ([#195](#195)) ([fa5478e](fa5478e))
* resolve issue [#198](#198) where moving sliders pan view ([#199](#199)) ([af62f2f](af62f2f))

### Documentation

* fix remaining CONTRIBUTING.md links in readme ([#197](#197)) @Abrar74774 Thank you! ([cbf922d](cbf922d))
github-actions bot pushed a commit that referenced this pull request Jan 10, 2026
## [1.7.0](v1.6.1...v1.7.0) (2026-01-10)

### Features

* add indonesian language ([#186](#186)) [@akmalsyrf](https://github.com/akmalsyrf) ([2ce342d](2ce342d))
* read-only mode ([#168](#168)) ([85d32e6](85d32e6))
* transparent background for exporting as png ([#180](#180)) @F4tal1t thank you for contributing as always! ([ba1b376](ba1b376))
* **ui:** enhance custom color picker and fix docs ([#169](#169)) thank you [@non-stop-dev](https://github.com/non-stop-dev) ([f56812c](f56812c))

### Bug Fixes

* build error caused by missing property in src/i18n/es-ES.ts ([#202](#202)) ([574b298](574b298))
* resolve issue [#136](#136) where "Add Node" popup has huge offset ([#195](#195)) ([fa5478e](fa5478e))
* resolve issue [#198](#198) where moving sliders pan view ([#199](#199)) ([af62f2f](af62f2f))

### Documentation

* fix remaining CONTRIBUTING.md links in readme ([#197](#197)) @Abrar74774 Thank you! ([cbf922d](cbf922d))
github-actions bot pushed a commit that referenced this pull request Jan 10, 2026
## [1.7.0](v1.6.1...v1.7.0) (2026-01-10)

### Features

* add indonesian language ([#186](#186)) [@akmalsyrf](https://github.com/akmalsyrf) ([2ce342d](2ce342d))
* read-only mode ([#168](#168)) ([85d32e6](85d32e6))
* transparent background for exporting as png ([#180](#180)) @F4tal1t thank you for contributing as always! ([ba1b376](ba1b376))
* **ui:** enhance custom color picker and fix docs ([#169](#169)) thank you [@non-stop-dev](https://github.com/non-stop-dev) ([f56812c](f56812c))

### Bug Fixes

* build error caused by missing property in src/i18n/es-ES.ts ([#202](#202)) ([574b298](574b298))
* resolve issue [#136](#136) where "Add Node" popup has huge offset ([#195](#195)) ([fa5478e](fa5478e))
* resolve issue [#198](#198) where moving sliders pan view ([#199](#199)) ([af62f2f](af62f2f))

### Documentation

* fix remaining CONTRIBUTING.md links in readme ([#197](#197)) @Abrar74774 Thank you! ([cbf922d](cbf922d))
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