Skip to content

Commit

Permalink
Merge pull request #9143 from lbaldy/bugfix/2727
Browse files Browse the repository at this point in the history
remove workaround introduced in #2180 after the proper fix from #2727
  • Loading branch information
AndrewGable authored Oct 7, 2022
2 parents d7651e0 + 82ab2aa commit bf00dca
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/withWindowDimensions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable react/no-unused-state */
import React, {forwardRef, createContext} from 'react';
import _ from 'underscore';
import PropTypes from 'prop-types';
import {Dimensions} from 'react-native';
import getComponentDisplayName from '../libs/getComponentDisplayName';
Expand Down Expand Up @@ -30,14 +29,7 @@ class WindowDimensionsProvider extends React.Component {
constructor(props) {
super(props);

// Using debounce here as a temporary fix for a bug in react-native
// https://github.com/facebook/react-native/issues/29290
// When the app is sent to background on iPads, onDimensionChange callback is called with
// swapped window dimensions before it was called with correct dimensions within miliseconds, then
// drawer is being positioned incorrectly due to animation issues in react-navigation.
// Adding debounce here slows down window dimension changes to let
// react-navigation to complete the positioning of elements properly.
this.onDimensionChange = _.debounce(this.onDimensionChange.bind(this), 100);
this.onDimensionChange = this.onDimensionChange.bind(this);

const initialDimensions = Dimensions.get('window');
const isSmallScreenWidth = initialDimensions.width <= variables.mobileResponsiveWidthBreakpoint;
Expand Down

0 comments on commit bf00dca

Please sign in to comment.