【发布时间】:2020-05-21 08:11:31
【问题描述】:
我的弹出窗口中的文本无法选择。我可以通过单击等方式关闭弹出窗口,但是当将指针悬停在文本上时,指针仍然是手形图标,并且永远不会变成 I 形文本选择图标。我尝试了几种不同的方式添加弹出窗口,但无济于事:
//with visgl/react-mapbox-gl:
<Popup latitude={0.0} longitude={0.0}>this text is unselectable</Popup>
//via the regular api:
new MapboxGL.Popup()
.setLngLat([0.0, 0.0])
.setHtml(<h1>this text is also unselectable</h1>)
.addTo(map);
//this method that I copied from somewhere:
const placeholder = document.createElement('div');
ReactDOM.render(<h1>still unselectable</h1>, placeholder);
new MapboxGL.Popup()
.setDOMContent(placeholder)
.setLngLat()
.addTo(map);
【问题讨论】:
标签: reactjs typescript mapbox-gl-js mapbox-gl react-map-gl