Update intersection-observer to version 0.4.0 (#4398)

signup-info-prompt
Yamagishi Kazutoshi 2017-07-27 23:20:48 +09:00 committed by Eugen Rochko
parent 73890c3cac
commit f2233c3e25
3 changed files with 6 additions and 11 deletions

View File

@ -107,17 +107,12 @@ export default class Status extends ImmutablePureComponent {
this.height = getRectFromEntry(entry).height; this.height = getRectFromEntry(entry).height;
} }
// Edge 15 doesn't support isIntersecting, but we can infer it
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12156111/
// https://github.com/WICG/IntersectionObserver/issues/211
const isIntersecting = (typeof entry.isIntersecting === 'boolean') ?
entry.isIntersecting : entry.intersectionRect.height > 0;
this.setState((prevState) => { this.setState((prevState) => {
if (prevState.isIntersecting && !isIntersecting) { if (prevState.isIntersecting && !entry.isIntersecting) {
scheduleIdleTask(this.hideIfNotIntersecting); scheduleIdleTask(this.hideIfNotIntersecting);
} }
return { return {
isIntersecting: isIntersecting, isIntersecting: entry.isIntersecting,
isHidden: false, isHidden: false,
}; };
}); });

View File

@ -57,7 +57,7 @@
"glob": "^7.1.1", "glob": "^7.1.1",
"http-link-header": "^0.8.0", "http-link-header": "^0.8.0",
"immutable": "^3.8.1", "immutable": "^3.8.1",
"intersection-observer": "^0.3.2", "intersection-observer": "^0.4.0",
"intl": "^1.2.5", "intl": "^1.2.5",
"intl-relativeformat": "^2.0.0", "intl-relativeformat": "^2.0.0",
"is-nan": "^1.2.1", "is-nan": "^1.2.1",

View File

@ -3608,9 +3608,9 @@ interpret@^1.0.0:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
intersection-observer@^0.3.2: intersection-observer@^0.4.0:
version "0.3.2" version "0.4.0"
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.3.2.tgz#9ed30021c08b29e9e8565c8d512ed84515727433" resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.4.0.tgz#e7c3580be96fc1698170250b500da986c59824fb"
intl-format-cache@^2.0.5: intl-format-cache@^2.0.5:
version "2.0.5" version "2.0.5"