Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove workaround introduced in #2180 after the proper fix from #2727 #9143

Merged
merged 2 commits into from
Oct 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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