microsoft / microsoft/pxt-microbit
Extra blank lines appear above the inserted JavaScript code snippet
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
Describe the bug
When the user drags a JS code snippet from the toolbox into the editor, extra blank lines appear above the inserted code.
Steps to reproduce the behavior:
- Navigate to https://makecode.microbit.org/beta
- Create a new project and switch to the JavaScript editor.
- Drag a code snippet from the toolbox into the editor.
- Observe the formatting of the inserted code.
Actual behavior
Extra blank lines appear above the inserted JavaScript code snippet.
Expected behavior
No extra blank lines appear above the inserted JavaScript code snippet.
Screen recording
Additional context
1.OS: Windows 11 24H2
2.Browser: Chrome, Firefox, Edge
3.makecode.microbit.org version: 7.1.48
4.Microsoft MakeCode version: 11.4.37
More Info
1.It works fine on the Python editor.
2.It's not a regression issue, also reproduced in Live build 7.0.61
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
Reproduce the issue in the JavaScript editor by dragging a toolbox snippet into a new project, then trace the editor's drag-and-insert formatting path. The fix is complete when inserted JavaScript has no extra blank lines above it and Python insertion remains unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100