Skip to content

Commit 8d661d2

Browse files
Merge pull request #17899 from hungvu193/fix-16931
Fix screen shaking when editing between 2 tabs
2 parents 63a292a + 38f9692 commit 8d661d2

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/pages/home/report/ReportActionItemMessageEdit.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {InteractionManager, Keyboard, View} from 'react-native';
55
import PropTypes from 'prop-types';
66
import _ from 'underscore';
77
import ExpensiMark from 'expensify-common/lib/ExpensiMark';
8-
import {withOnyx} from 'react-native-onyx';
98
import reportActionPropTypes from './reportActionPropTypes';
109
import styles from '../../../styles/styles';
1110
import Composer from '../../../components/Composer';
@@ -26,7 +25,6 @@ import CONST from '../../../CONST';
2625
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
2726
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
2827
import withKeyboardState, {keyboardStatePropTypes} from '../../../components/withKeyboardState';
29-
import ONYXKEYS from '../../../ONYXKEYS';
3028
import * as ComposerUtils from '../../../libs/ComposerUtils';
3129

3230
const propTypes = {
@@ -36,9 +34,6 @@ const propTypes = {
3634
/** Draft message */
3735
draftMessage: PropTypes.string.isRequired,
3836

39-
/** Number of lines for the draft message */
40-
numberOfLines: PropTypes.number,
41-
4237
/** ReportID that holds the comment we're editing */
4338
reportID: PropTypes.string.isRequired,
4439

@@ -67,7 +62,6 @@ const defaultProps = {
6762
forwardedRef: () => {},
6863
report: {},
6964
shouldDisableEmojiPicker: false,
70-
numberOfLines: undefined,
7165
preferredSkinTone: CONST.EMOJI_DEFAULT_SKIN_TONE,
7266
};
7367

@@ -82,7 +76,6 @@ class ReportActionItemMessageEdit extends React.Component {
8276
this.onSelectionChange = this.onSelectionChange.bind(this);
8377
this.addEmojiToTextBox = this.addEmojiToTextBox.bind(this);
8478
this.setExceededMaxCommentLength = this.setExceededMaxCommentLength.bind(this);
85-
this.updateNumberOfLines = this.updateNumberOfLines.bind(this);
8679
this.saveButtonID = 'saveButton';
8780
this.cancelButtonID = 'cancelButton';
8881
this.emojiButtonID = 'emojiButton';
@@ -160,14 +153,6 @@ class ReportActionItemMessageEdit extends React.Component {
160153
}
161154
}
162155

163-
/**
164-
* Update the number of lines for a draft in Onyx
165-
* @param {Number} numberOfLines
166-
*/
167-
updateNumberOfLines(numberOfLines) {
168-
Report.saveReportActionDraftNumberOfLines(this.props.reportID, this.props.action.reportActionID, numberOfLines);
169-
}
170-
171156
/**
172157
* Delete the draft of the comment being edited. This will take the comment out of "edit mode" with the old content.
173158
*/
@@ -303,8 +288,6 @@ class ReportActionItemMessageEdit extends React.Component {
303288
}}
304289
selection={this.state.selection}
305290
onSelectionChange={this.onSelectionChange}
306-
numberOfLines={this.props.numberOfLines}
307-
onNumberOfLinesChange={this.updateNumberOfLines}
308291
/>
309292
<View style={styles.editChatItemEmojiWrapper}>
310293
<EmojiPickerButton
@@ -346,12 +329,6 @@ export default compose(
346329
withLocalize,
347330
withWindowDimensions,
348331
withKeyboardState,
349-
withOnyx({
350-
numberOfLines: {
351-
key: ({reportID, action}) => `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${reportID}_${action.reportActionID}`,
352-
initWithStoredValues: false,
353-
},
354-
}),
355332
)(React.forwardRef((props, ref) => (
356333
/* eslint-disable-next-line react/jsx-props-no-spreading */
357334
<ReportActionItemMessageEdit {...props} forwardedRef={ref} />

0 commit comments

Comments
 (0)