Skip to content

Instantly share code, notes, and snippets.

Idea

#127 "ScrollView in modal prevents modal from dismissing sometimes" - https://github.com/react-navigation/stack/issues/127

This issue has a good discussion and a comment:

brentvatne: it's not really possible for react-navigation to guess when you may or may not want to close the modal depending on other gestures you have inside of a scene, you need to define that behavior for yourself. you can access the gesture context like this: https://github.com/react-navigation/react-navigation-stack/blob/5f157cbc16f2dd15363304ab3c78663b0ed36de0/example/src/GestureInteraction.js#L55-L56 then you can use react-native-gesture-handler tools to make this behave how you like.

@yurydelendik
yurydelendik / pdfjs-divBoundFor.js
Last active October 27, 2017 13:35
PDF.js get text layer divs bounds
function divBoundsFor(pageIndex) {
var page = document.querySelectorAll('.page')[pageIndex];
var textLayer = page && page.querySelector('.textLayer');
if (!textLayer) return null;
var textLayerBounds = textLayer.getBoundingClientRect();
var divs = textLayer.querySelectorAll('div');
var bounds = Array.prototype.map.call(divs, function (d) {
var r = d.getBoundingClientRect();
return {
left: r.left - textLayerBounds.left,