Skip to content

Commit

Permalink
Merge pull request #26283 from ShogunFire/fixInputComposerHiddenBehin…
Browse files Browse the repository at this point in the history
…dKeyboard

 Fix the composer being hidden by the keyboard by subscribing to top most report changes in ReportScreen
  • Loading branch information
flodnv authored Sep 11, 2023
2 parents b82bc07 + 0665ea0 commit 84f3ede
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import ReportScreenContext from './ReportScreenContext';
import TaskHeaderActionButton from '../../components/TaskHeaderActionButton';
import DragAndDropProvider from '../../components/DragAndDrop/Provider';
import usePrevious from '../../hooks/usePrevious';
import withCurrentReportID, {withCurrentReportIDPropTypes, withCurrentReportIDDefaultProps} from '../../components/withCurrentReportID';

const propTypes = {
/** Navigation route context info provided by react navigation */
Expand Down Expand Up @@ -88,6 +89,7 @@ const propTypes = {

...windowDimensionsPropTypes,
...viewportOffsetTopPropTypes,
...withCurrentReportIDPropTypes,
};

const defaultProps = {
Expand All @@ -102,6 +104,7 @@ const defaultProps = {
policies: {},
accountManagerReportID: null,
personalDetails: {},
...withCurrentReportIDDefaultProps,
};

/**
Expand Down Expand Up @@ -131,6 +134,7 @@ function ReportScreen({
viewportOffsetTop,
isComposerFullSize,
errors,
currentReportID,
}) {
const firstRenderRef = useRef(true);
const flatListRef = useRef();
Expand All @@ -157,7 +161,7 @@ function ReportScreen({

const policy = policies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];

const isTopMostReportId = Navigation.getTopmostReportId() === getReportID(route);
const isTopMostReportId = currentReportID === getReportID(route);

let headerView = (
<HeaderView
Expand Down Expand Up @@ -396,6 +400,7 @@ export default compose(
withLocalize,
withWindowDimensions,
withNetwork(),
withCurrentReportID,
withOnyx({
isSidebarLoaded: {
key: ONYXKEYS.IS_SIDEBAR_LOADED,
Expand Down

0 comments on commit 84f3ede

Please sign in to comment.