-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 cursor rendering #2932
Fix cursor rendering #2932
Conversation
core/keyboard_nav/cursor_svg.js
Outdated
newParent.appendChild(svgRoot); | ||
if (this.isMarker_) { | ||
for (var i = 0, childNode; childNode = newParent.childNodes[i]; i++) { | ||
if (childNode.className.baseVal == Blockly.CursorSvg.CURSOR_CLASS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blockly.utils.dom.hasClass(childNode , Blockly.CursorSvg.CURSOR_CLASS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
} | ||
newParent.insertBefore(svgRoot, cursorNode); | ||
} else { | ||
newParent.appendChild(svgRoot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, is this just trying to make sure that the marker cursor comes before the cursor cursor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, otherwise the marker will cover the cursor and you won't be able to see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The basics
The details
Resolves
The cursor should always be shown on top of the marker so that it does not disappear when a user marks a connection.
Proposed Changes
Update the position of the marker and the cursor in the dom so that the cursor is always after the marker.
Reason for Changes
Test Coverage
Tested on:
Documentation
Additional Information