[Glitch] Fix text being incorrectly pre-selected in composer textarea on /share
Port 335049cc33
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
parent
67028c4779
commit
1800e05513
|
@ -58,6 +58,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
onPickEmoji: PropTypes.func,
|
||||
showSearch: PropTypes.bool,
|
||||
anyMedia: PropTypes.bool,
|
||||
isInReply: PropTypes.bool,
|
||||
singleColumn: PropTypes.bool,
|
||||
|
||||
advancedOptions: ImmutablePropTypes.map,
|
||||
|
@ -233,7 +234,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
// Caret/selection handling.
|
||||
if (focusDate !== prevProps.focusDate) {
|
||||
switch (true) {
|
||||
case preselectDate !== prevProps.preselectDate && preselectOnReply:
|
||||
case preselectDate !== prevProps.preselectDate && this.props.isInReply && preselectOnReply:
|
||||
selectionStart = text.search(/\s/) + 1;
|
||||
selectionEnd = text.length;
|
||||
break;
|
||||
|
|
|
@ -68,6 +68,7 @@ function mapStateToProps (state) {
|
|||
spoilersAlwaysOn: spoilersAlwaysOn,
|
||||
mediaDescriptionConfirmation: state.getIn(['local_settings', 'confirm_missing_media_description']),
|
||||
preselectOnReply: state.getIn(['local_settings', 'preselect_on_reply']),
|
||||
isInReply: state.getIn(['compose', 'in_reply_to']) !== null,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue