Skip to content

Commit

Permalink
Merge pull request Expensify#55047 from truph01/fix/54157
Browse files Browse the repository at this point in the history
fix: Android - Create Chat - "You appear to be offline" is displayed floating on room creation
  • Loading branch information
youssef-lr authored Jan 17, 2025
2 parents 894fbd0 + e3abe65 commit 57f544f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
13 changes: 12 additions & 1 deletion src/components/ValuePicker/ValueSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import type {ValueSelectorModalProps} from './types';

function ValueSelectorModal({items = [], selectedItem, label = '', isVisible, onClose, onItemSelected, shouldShowTooltips = true, onBackdropPress}: ValueSelectorModalProps) {
function ValueSelectorModal({
items = [],
selectedItem,
label = '',
isVisible,
onClose,
onItemSelected,
shouldShowTooltips = true,
onBackdropPress,
shouldEnableKeyboardAvoidingView = true,
}: ValueSelectorModalProps) {
const styles = useThemeStyles();

const sections = useMemo(
Expand All @@ -31,6 +41,7 @@ function ValueSelectorModal({items = [], selectedItem, label = '', isVisible, on
includePaddingTop={false}
includeSafeAreaPaddingBottom
testID={ValueSelectorModal.displayName}
shouldEnableKeyboardAvoidingView={shouldEnableKeyboardAvoidingView}
>
<HeaderWithBackButton
title={label}
Expand Down
6 changes: 2 additions & 4 deletions src/components/ValuePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import useStyleUtils from '@hooks/useStyleUtils';
import Navigation from '@libs/Navigation/Navigation';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import KeyboardUtils from '@src/utils/keyboard';
import type {ValuePickerItem, ValuePickerProps} from './types';
import ValueSelectorModal from './ValueSelectorModal';

Expand All @@ -15,9 +14,7 @@ function ValuePicker({value, label, items, placeholder = '', errorText = '', onI
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
KeyboardUtils.dismiss().then(() => {
setIsPickerVisible(true);
});
setIsPickerVisible(true);
};

const hidePickerModal = () => {
Expand Down Expand Up @@ -57,6 +54,7 @@ function ValuePicker({value, label, items, placeholder = '', errorText = '', onI
onItemSelected={updateInput}
shouldShowTooltips={shouldShowTooltips}
onBackdropPress={Navigation.dismissModal}
shouldEnableKeyboardAvoidingView={false}
/>
</View>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/ValuePicker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type ValueSelectorModalProps = {

/** Whether to show the tooltip text */
shouldShowTooltips?: boolean;

/** Flag to indicate if the keyboard avoiding view should be enabled */
shouldEnableKeyboardAvoidingView?: boolean;
};

type ValuePickerProps = {
Expand Down

0 comments on commit 57f544f

Please sign in to comment.