airflow
airflow copied to clipboard
fix :RedshiftDataOperator fails when return_sql_result is true
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.
you can do panOnDrag={[2]} so that the second mouse button is for activating dragging. Does it work?
I have setup [1,2], but it doesn't work. Also tried with nodeDragThreshold={1}
drag threshold won't do you any good here because you're not dragging the node technically as that's only possible with left-click.
Tricky tbh, because to get the pane to move while using the mouse on a node (regardless of left or right click) requires the node to not be draggable - otherwise the nopan classname is applied which prevents panning the viewport while on a node/edge.
For example this would work:
<ReactFlow
nodesDraggable={false}
onNodeClick={() => {
alert("open ctx menu");
}}
onNodeContextMenu={(e) => {
const event = e.nativeEvent;
event.preventDefault();
event.stopImmediatePropagation();
}}
panOnDrag={[2]}
// ...
But I assume you'd rather like to have nodes be draggable and also allowing this functionality... 🤔
@bcakmakoglu thanks, exactly, I want to keep simple dragging using left click.
so I might then check if that event is right click -> make node not dragable and after release - reset. but will it work ?
No that's not gonna work. Once you have right-clicked, changing the draggable option of nodes will not take effect after releasing and then doing it again while node dragging is disabled 😐
I'd love to achieve this behaviour too. Do we think this is possible with the current API, or does it require internal changes?
Is this a bug? We need to check if this is really not working in the latest version.
I can confirm that this is not working. But I am also not sure what to do about this. panOnDrag=[1] doesn't change anything about how you can drag nodes either so it would be weird if panOnDrag=[2] would do something else here. Only idea for now is to add a forcePan.. prop or something like that but I don't really like it. @peterkogo any ideas about this?
Thank you for looking into this! Just want to chime in and say my team is also struggling to implement this with the current ReactFlow API. I think it would be a great feature since it's the UX that Miro users are familiar with.
@lindemer It's not a perfect solution but you could try doing sth like this
onNodeContextMenu={(event) => {
event.preventDefault();
const paneEl = document.querySelector(".react-flow__pane")!;
paneEl.dispatchEvent(new MouseEvent("mousedown", event));
}}
Here's an example: https://codesandbox.io/p/sandbox/mutable-paper-hd8j9x?file=%2Fsrc%2FApp.tsx%3A35%2C1-41%2C9
Thanks for the tip @bcakmakoglu!