-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
component: eventsissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wronglow priority
Description
Describe the bug
The scrollbar resize call can unintentionally scroll.
To Reproduce
- Add 4 blocks with space between them and prepare a 5th block that would fit in empty space.
Blockly.Xml.domToWorkspace(
Blockly.Xml.textToDom(
'<xml xmlns="https://developers.google.com/blockly/xml">' +
'<block type="controls_if" x="88" y="88"></block>' +
'<block type="controls_if" x="288" y="88"></block>' +
'<block type="controls_if" x="88" y="238"></block>' +
'<block type="controls_if" x="288" y="238"></block>' +
'</xml>'),
workspace);
var xmlDom = Blockly.Xml.textToDom(
'<xml xmlns="https://developers.google.com/blockly/xml">' +
'<block type="controls_if" x="188" y="163"></block> +
'</xml>');
- Set breakpoints at
onScroll()call inScrollbar.prototyle.resizeand inWorkspaceSvg.setTopLevelWorkspaceMetrics_ - Add block in the middle of the existing blocks, should not trigger any scrolling.
Blockly.Xml.domToWorkspace(xmlDom, workspace);
- Step through breakpoints observing that
hostmetrics.viewLeftis 0 inScrollbar resize, but insetTopLevelWorkspaceMetrics_this.scrollYis set to small but non-zero value, where we would expect zero.
Expected behavior
There shouldn't be scrolling.
Additional context
This can cause unwanted extra emission of viewport change events, once they are enabled.
Metadata
Metadata
Assignees
Labels
component: eventsissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wronglow priority