You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using material-ui along with AbsoluteGrid. When I have the TextField component in my grid item component, I cannot click on the TextField to select it and start editing text. Only with dragEnabled=false does this work. I believe this is because the AbsoluteGrid is eating the touch events in the onDrag function.
The text was updated successfully, but these errors were encountered:
@muuhoffman curious whether you ever solved this, if not or for anyone else running into this, I've done the following. It's not pretty, but it works by wrapping createAbsoluteGrid like this:
importcreateAbsoluteGridfrom'react-absolute-grid';exportdefault(...args)=>{constAbsoluteGridBase=createAbsoluteGrid(...args);classAbsoluteGridextendsAbsoluteGridBase{constructor(props,context){super(props,context);constoriginalStartDrag=this.dragManager.startDrag.bind(this.dragManager);this.dragManager.startDrag=(e,domNode,item,fnUpdate)=>{// Prevent preventDefault to allow focus on inputif(e.target.nodeName==='INPUT'){e.preventDefault=()=>{};}originalStartDrag(e,domNode,item,fnUpdate);};}}returnAbsoluteGrid;};
it would be nice if one could define exceptions to the preventDefault behavior in the props instead
I am using material-ui along with AbsoluteGrid. When I have the TextField component in my grid item component, I cannot click on the TextField to select it and start editing text. Only with dragEnabled=false does this work. I believe this is because the AbsoluteGrid is eating the touch events in the onDrag function.
The text was updated successfully, but these errors were encountered: