Skip to content

Commit

Permalink
fix(Clause): fixes clauses being uneditable in safari when draggable
Browse files Browse the repository at this point in the history
Signed-off-by: Diana Lease <dianarlease@gmail.com>
  • Loading branch information
DianaLease committed Jun 17, 2020
1 parent c6a5484 commit da8415d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ const ClauseComponent = React.forwardRef((props, ref) => {
}
};

const setDraggable = (event, draggable) => event.target.closest('.ui-contract-editor__clause').setAttribute('draggable', draggable);

return (
<ClauseContext.Provider value={hovering}>
<S.ClauseWrapper
Expand Down Expand Up @@ -235,7 +237,10 @@ const ClauseComponent = React.forwardRef((props, ref) => {
</S.DeleteWrapper>
</>
}
<S.ClauseBody>
<S.ClauseBody
onMouseEnter={(e) => setDraggable(e, false)}
onMouseLeave={(e) => setDraggable(e, true)}
>
{props.children}
</S.ClauseBody>
</S.ClauseWrapper>
Expand Down

0 comments on commit da8415d

Please sign in to comment.