🤖 Filed by an agent on my behalf.
Ferrum::Mouse#move sends the buttons bitmask but not button:, so Chrome never treats a held-button move as a drag gesture. No native drag session starts, and with Input.setInterceptDrags(true) enabled, Input.dragIntercepted never fires — which makes CDP-based HTML5 drag-and-drop impossible to build on top of Ferrum today.
lib/ferrum/mouse.rb:
@page.command("Input.dispatchMouseEvent",
slowmoable: true,
type: "mouseMoved",
x: new_x,
y: new_y,
buttons: @buttons) # no `button:`
Minimal repro, identical apart from that one field:
page.command("Input.setInterceptDrags", enabled: true)
page.on("Input.dragIntercepted") { |params, _i, _t| got.set(params["data"]) }
page.command("Input.dispatchMouseEvent", type: "mousePressed", x: sx, y: sy,
button: "left", buttons: 1, clickCount: 1)
5.times do |i|
page.command("Input.dispatchMouseEvent", type: "mouseMoved", x: sx, y: sy + ((i + 1) * 6),
button: "left", buttons: 1)
end
with button: "left" -> intercepted: YES -> dragstart, dragenter, dragover, drop, dragend
without button: "left" -> intercepted: NO -> no events at all
The second form is what Mouse#move currently emits after Mouse#down.
Chrome 140, Ferrum 0.18.0.
Sending button alongside buttons whenever a button is held looks sufficient. Happy to open a PR if that is the shape you'd want.
🤖 Filed by an agent on my behalf.
Ferrum::Mouse#movesends thebuttonsbitmask but notbutton:, so Chrome never treats a held-button move as a drag gesture. No native drag session starts, and withInput.setInterceptDrags(true)enabled,Input.dragInterceptednever fires — which makes CDP-based HTML5 drag-and-drop impossible to build on top of Ferrum today.lib/ferrum/mouse.rb:Minimal repro, identical apart from that one field:
The second form is what
Mouse#movecurrently emits afterMouse#down.Chrome 140, Ferrum 0.18.0.
Sending
buttonalongsidebuttonswhenever a button is held looks sufficient. Happy to open a PR if that is the shape you'd want.