mdx-editor / mdx-editor/editor
[BUG] Link Popover position is incorrect after window resized
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 307
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 5
Description
- I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- I have read the documentation and cannot find an answer.
Describe the bug
Link Popover position is incorrect after window resized
To Reproduce
Steps to reproduce the behavior:
- Open https://mdxeditor.dev/editor/demo
- Click on the link
[— Daring Fireball](https://daringfireball.net/projects/markdown/), the link popover is displayed right near the link as expected - Click anywhere on the webpage to let editor lose focus. Make sure the editor loses focus, otherwise the bug can not be reproduced.
- Resize the window.
- See error: the link popover is on the top-left corner. It's expected to stay close to the link.
Expected behavior
At the last step, the link popover is expected to stay close to the link.
Screenshots
Desktop (please complete the following information):
- OS: MacOS
- Browser [e.g. Chrome, Safari]: Chrome 128.0.6587.0, Firefox 129.0.2 (64-bit).
Mobile:
- OS: iOS 17.5.1
- Browser: Safari
Additional context
LinkDialog.tsx fires publishWindowChange(true) when resizing happens, but link anchor is set to left:0; top:0 when editor loses focus.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LinkDialog.tsx and reproduce the sequence in the MDXEditor demo: open the link popover, let the editor lose focus, then resize the window. Trace how publishWindowChange(true) interacts with the link anchor's left:0 and top:0 position. Done means the popover remains close to the link after resizing while the editor is unfocused.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100