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
Hi, I am using this library to display some button so I could for example copy, share etc.
The problem is that the Popover disappear before the click event even trigger. there should be a settimeout at least so that click event may trigger if the popup previous state is visible.
Please could you check this out. I saw that you are using use-text-selection are you the owner of the library ?
should this problem be handled here or in use-text-selection.
Here is a code view should if you are interested of what I mean.
{this.props.bookOption.selectionMenus&&this.props.bookOption.selectionMenus.length ? (<Popovermount={this.chapterRef.currentasHTMLElement|undefined}render={({ clientRect, isCollapsed, textContent })=>{if(clientRect==null||isCollapsed)returnnullvarrow="";varcolumn="";if(this.props.bookOption.selectionMenus){this.props.bookOption.selectionMenus.forEach((_,i)=>{if(i%3===0)row+=" 1fr";});if(this.props.bookOption.selectionMenus.length>=3)column="1fr 1fr 1fr";elsecolumn=this.props.bookOption.selectionMenus.map(()=>"1fr").join(" ");}// I'm using emotion for this example but you can use anything reallyconststyle={position: "absolute",left: document.documentElement.scrollLeft+(clientRect.left+clientRect.width/2),top: document.documentElement.scrollTop+(clientRect.top-40),marginLeft: -75,gridTemplateColumns: column,gridTemplateRows: row}asReact.CSSPropertiesreturn<divclassName='bookMenu'style={style}>{this.props.bookOption.selectionMenus?.map((x,i)=>(<akey={i}onClick={(event)=>{// this never trigger.varresult={selectedText: textContent,rec: clientRect,menuIndex: i}asSelectionResultconsole.log(result)if(this.props.bookOption.selectionMenuClick)this.props.bookOption.selectionMenuClick(result);}}>{x.icon&&typeofx.icon==="string" ? (<imgsrc={x.icon}/>) : null}{x.icon&&typeofx.icon!=="string" ? (x.icon) : null}{x.text}</a>))}</div>}}/>) : null}
The text was updated successfully, but these errors were encountered:
Hi, I am using this library to display some button so I could for example copy, share etc.
The problem is that the
Popover
disappear before the click event even trigger. there should be asettimeout
at least so that click event may trigger if the popup previous state is visible.Please could you check this out. I saw that you are using
use-text-selection
are you the owner of the library ?should this problem be handled here or in
use-text-selection
.Here is a code view should if you are interested of what I mean.
The text was updated successfully, but these errors were encountered: