Comments (3)
这是由于iframe 没有on mouse up event 造成的,目前不知道咋解决,我在一个项目中也遇到了非常类似的问题
from react-split-pane.
Let me translate this in English to seek help from others:
this split pane won't work well when some pane has iframe, objects or embed elements in html. According to the MDN, these elements are not interactive elements so they do not have on mouse up event. Hence, when we release the mouse inside the area of objects or embeds, the mouse event won't be triggered. Any help or ideas about the fix would be highly appreciated.
Thanks!!
from react-split-pane.
I fix this by modifying my iframe element stlye about "pointer-events" when dragging.
It's quite a trouble to get the element,and I used useContext.
function SplitPaneWrapper({ className, children, ...props }: Props) {
const [sandboxRef] = useSandboxEle();
const onDragStarted = () => {
sandboxRef.current.style['pointer-events'] = 'none'
}
const onDragFinished = () => {
sandboxRef.current.style['pointer-events'] = 'auto'
}
return (
<SplitPane
className={className}
defaultSize={props.defaultSize ?? '50%'}
onDragStarted={onDragStarted}
onDragFinished={onDragFinished}
{...props}
>
{children}
</SplitPane>
);
}
from react-split-pane.
Related Issues (20)
- initial size and other options not working. HOT 2
- Updating a useState when on the page resets the sizing.
- Control the style of the Resizer which is being held
- Bug when I change browser zoom
- Weird behavior with nested SplitPanes HOT 1
- save split size change after refresh HOT 2
- Initial size based on content? HOT 2
- How can I fix this warning? HOT 1
- Hover event for splitter
- Dynamically adding panes HOT 2
- 'SplitPane' cannot be used as a JSX component. HOT 1
- Typescript warning with React 18 types HOT 9
- Dependency issue REACT 18.2.0 HOT 4
- Type Error
- Type Error (React 18.2.0) HOT 6
- Prop to add ToolTip to Resizer
- Hide, move, dock HOT 2
- <SplitPane>标签设置defaultSize、minSize和maxSize不起作用
- Legacy context API has been detected within a strict-mode tree. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-split-pane.