Comments (8)
Also I'm seeing a ton of these messages when using Chrome
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See <URL>
react-dom.development.js:1650 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
preventDefault @ react-dom.development.js:1650
doNotMove @ index.js:8
startMoving @ index.js:139
callCallback @ react-dom.development.js:542
invokeGuardedCallbackDev @ react-dom.development.js:581
invokeGuardedCallback @ react-dom.development.js:438
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:452
executeDispatch @ react-dom.development.js:836
executeDispatchesInOrder @ react-dom.development.js:858
executeDispatchesAndRelease @ react-dom.development.js:956
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:967
forEachAccumulated @ react-dom.development.js:935
processEventQueue @ react-dom.development.js:1112
runEventQueueInBatch @ react-dom.development.js:3607
handleTopLevel @ react-dom.development.js:3616
handleTopLevelImpl @ react-dom.development.js:3347
batchedUpdates @ react-dom.development.js:11082
batchedUpdates @ react-dom.development.js:2330
dispatchEvent @ react-dom.development.js:3421
`
from react-flip-page.
Hey @talkingtab, I do believe you have everything needed to do what you want with both startSwiping
and stopSwiping
callbacks.
You could use a state part in your child component that would indicate if you render the image, or the video. And this state property would be updated accordingly on startSwiping
or stopSwiping
. Do you understand what I mean?
Also, I have not been able to see those messages. When do you see them?
from react-flip-page.
I agree at this point I don't need anything. The messages come [sigh] when I am using Chrome Canary only. Sorry about that.
from react-flip-page.
What I did was to take the react-flip-page code and add an "active" state that is passed as a prop to the children. Basically "if not swiping and this page is the same as this.state.page then set active true" when doing the cloneElement(). If the component is not active (because of swiping or being on another page) I just render an image - a jpg. If the component is active then I render the video component. This works well if I have two images one for active and one for not. When I substitute a video for the active component I still see exactly the same problem I had originally- one half of the video is active and plays and the other half is a static half-image that does not play.
I'm now thinking that this must be an effect of how react-flip-page renders the child component in two halves. I have not plowed into that code yet, but my first thought is to use the "active" flag to have react-flip-page render the component differently (singularly) when it is active. Basically when render() is called and active is true to have it skip much of renderPage(). Just wanted to get your thinking?
from react-flip-page.
The idea of an active
prop is interesting.
However, the concept of react-flip-page
rendering the component differently following active
doesn't please me. As you mentioned the prop is passed to the current page, that's what you would use inside your component to render accordingly.
As a drawback, this obliges creation of a child component to use the active
prop properly.
from react-flip-page.
I agree it is not pleasing. For now I am just trying to find a way, any way at all to get it to work. I don't really understand what is going on with the
I did try what you suggested, which was to render my component differently when "active" but I still got the split screen with one half playing and the other not.
from react-flip-page.
I think that's because you set the active
property on page change only. Which causes the current page to still be active even while moving.
from react-flip-page.
Closing because no activity.
from react-flip-page.
Related Issues (20)
- How can I hide the page shadowing? HOT 6
- Issue: Input fields and drop-downs do not work HOT 1
- Could not find declaration for Module 'react-flip-page' HOT 2
- Error when adding responsive attribute HOT 2
- Error using ref in Functional Component TypeError: flipPage.gotoNextPage is not a function HOT 2
- An in-range update of babel7 is breaking the build 🚨 HOT 11
- Update the value of startAt after the first render HOT 1
- Using gotoNextPage after flip half page correctly but the other half flips immediately without notice HOT 3
- Security vulnerability for uglifyjs-webpack-plugin/serialize-javascript HOT 9
- Using on Mobile devices gives unexpected black background HOT 2
- flipOnTouch and goto methods - uncutPages does not work, half the animation does not work HOT 3
- Background Color Split in two for Span when it sits Between Pages HOT 2
- Next JS - ReferenceError: window is not defined HOT 1
- Pages blank until after flipped HOT 10
- cannot use input element HOT 1
- Position of "middle of page" HOT 1
- Fragments HOT 4
- TypeError: Cannot set property 'FlipPage' of undefined HOT 1
- Is this supporting on react-native also ? HOT 2
- gotoPage(page) its not reflecting animation effect
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-flip-page.