Rejig interactives disableArticleSwipe implementation - #14112
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
|
Size Change: +57 B (+0.01%) Total Size: 1.05 MB ℹ️ View Unchanged
|
| .catch((error) => { | ||
| log('dotcom', 'disableArticleSwipe(false) failed', error); | ||
| }); | ||
| }; |
There was a problem hiding this comment.
I'm wondering if you want the article to always have the article swipe disabled? If that's the case, it might be better to not ever set this to true, what do you think?
There was a problem hiding this comment.
Ah that's a great shout! Yes, we always want interactives to have the article swipe disabled, have removed touchend events with bd01f1c
| document.removeEventListener('touchend', onTouchEnd); | ||
| }; | ||
| }, []); | ||
| return null; |
There was a problem hiding this comment.
Also wondering if you tested the number of events that are being fired. I think this might cause too many events being fired and might have performance side effect. I'm not sure though, it needs testing
There was a problem hiding this comment.
I haven't, it's tricky to get things in the emulators pre-beta, though it shouldn't fire any more than carousels or key events on live blogs should it? A blanket on/off switch would be ideal but my understanding is that's not how the Android implementation works
There was a problem hiding this comment.
I will setup my android simulator now and will test this. Will let you know 👍
|
Seen on PROD (merged by @frederickobrien 8 minutes and 53 seconds ago) Please check your changes! |
This adjusts the what was implemented in #14111 to be more akin to other uses of the same function i.e. having
onTouchStartandonTouchEndevents run constantly.Documentation over in the Android app suggests that the Bridget function only locks the next swipe event. That being the case it needs to run on every interaction rather than once when the page loads.
Now I think of it this is also safer in the sense that if someone were to interact with a carousel on an interactives article, with the prior approach it would then be left turned on!