Comments (7)
Changing these lines in ReflexSplitter:L82:L85
to set the handler to non-passive, fixes the navigation issue.
this.document.addEventListener(
'touchmove',
this.onMouseMove,
{ passive: false } // added to fix the unwanted back / forward navigation
);
The warning I mentioned earlier is still thrown by some of the events; but it's no longer causing any issues. I do however think that some of the preventDefault
s or stopPropagation
aren't really necessary. Especially since they're already being ignored anyway.
from re-flex.
Awesome! I fixed that in v 2.0.9 and removed preventDefault stopPropagation
in mouse down event. Thanks.
from re-flex.
There is already support for touch screens, this is done by tweaking the reflex-splitter
style adding reflex-thin
style. By default this style is activated for mobile platforms using the code in Browser.js. On your machine isMobile
probably returns false and default style is applied. A simple workaround would be that you manually force reflex-thin
on the splitter:
<ReflexSplitter className="reflex-thin">
.
Alternatively you can take a look at reflex-styles.scss and overwrite the default style to suit your needs or add your styles in your own css class then applied it to the splitter as above using className
.
from re-flex.
reflex-thin
seems to help, but I guess there is a preventDefault
missing? When dragging to the right, chrome starts to navigate to the previous page:
from re-flex.
preventDefault
is there, check the ReflexSplitter source.
I cannot reproduce this issue on my side, works fine in the mobile emulator as well as on iOS and Android... What platform/browser are you running that? And when does the navigation occur, is it on mouse move?
from re-flex.
It happens when the chrome flag
overscroll-history-navigation
is set to enabled
. Disabling it fixes the behavior. Although it is an experimental function; I cannot remember that I've enabled it myself.
chrome://flags/#overscroll-history-navigation
Using Chrome 61.0.3163.59
on Windows 10.1703
, both 64 bit.
The navigation occurs when dragging the splitter with the finger on the touch screen. The mouse (touchpad) is behaving as expected. It's because my device has both; a touchpad and a touchscreen.
from re-flex.
I'm guessing it has to do with the warning in my console:
ReflexSplitter.js? [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
onMouseMove @ ReflexSplitter.js?:134
https://www.chromestatus.com/features/5093566007214080
Treat Document Level Touch Event Listeners as Passive
DOMAddEventListenerOptions defaults passive to false. With this change touchstart and touchmove listeners added to the document will default to passive:true (so that calls to preventDefault will be ignored)..
If the value is explicitly provided in the AddEventListenerOptions it will continue having the value specified by the page.
This is behind a flag starting in Chrome 54, and enabled by default in Chrome 56. See https://developers.google.com/web/updates/2017/01/scrolling-intervention
Seems related:
from re-flex.
Related Issues (20)
- Component state is reinitialized when a ReflexElement is collapsing HOT 1
- React 18 typescript problem HOT 5
- Cannot read property 'ref' of undefined HOT 2
- React 18 peers dependency HOT 1
- Not working with nextjs HOT 9
- windowResizeAware horizontal container HOT 1
- ag-grid doesn't display in a resizable pane HOT 6
- Contrlled elemented example with functional components HOT 1
- Problem installing v4.0.11 on Yarn HOT 4
- node-sass as a dependency? HOT 1
- Where to find a description of version changes? HOT 1
- Reflex doesn't render properly when used in a <Suspense> HOT 2
- Question: Need to wrap "ReflexSplitter" inside "SplitterControl" component to add custom logic HOT 4
- Make component work with Content Security Policy by adding nonce attribute HOT 1
- Remove unnecessary console.logs from ReflexSplitter.js HOT 1
- Question: How to disable the ReflexSplitter? HOT 2
- can you add a new feature please HOT 1
- ReflexElement element size is not updated when the value passed to minSize prop is changed HOT 3
- Reflex element with a specific flex is displayed incorrectly, when the container size changed HOT 3
- react-reflex Doesn't Seem to Work as Expected Inside FrameComponent HOT 1
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 re-flex.