mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1251492 - Don't prevent default behavior of unrelated mouse events in HSplitBox. r=linclark
This commit is contained in:
parent
74c6f50e80
commit
f92f7a7fae
@ -69,11 +69,19 @@ module.exports = createClass({
|
||||
},
|
||||
|
||||
_onMouseDown(event) {
|
||||
if (event.button !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({ mouseDown: true });
|
||||
event.preventDefault();
|
||||
},
|
||||
|
||||
_onMouseUp(event) {
|
||||
if (event.button !== 0 || !this.state.mouseDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({ mouseDown: false });
|
||||
event.preventDefault();
|
||||
},
|
||||
|
@ -80,7 +80,7 @@ window.onload = Task.async(function* () {
|
||||
const splitter = document.querySelector(".h-split-box-splitter");
|
||||
ok(splitter, "Should get our splitter");
|
||||
|
||||
synthesizeMouseAtCenter(splitter, { button: 1, type: "mousedown" }, window);
|
||||
synthesizeMouseAtCenter(splitter, { button: 0, type: "mousedown" }, window);
|
||||
|
||||
function mouseMove(clientX) {
|
||||
const event = new MouseEvent("mousemove", { clientX });
|
||||
@ -103,7 +103,7 @@ window.onload = Task.async(function* () {
|
||||
is(newSizes.length, 4, "Should get 4 resizes");
|
||||
ok(aboutEq(newSizes[3], .75), "New size should be ~.75");
|
||||
|
||||
synthesizeMouseAtCenter(splitter, { button: 1, type: "mouseup" }, window);
|
||||
synthesizeMouseAtCenter(splitter, { button: 0, type: "mouseup" }, window);
|
||||
|
||||
// Now that we have let go of the splitter, mouse moves should not result in resizes.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user