Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
QOTO
qoto
Commits
3a103cd3
Unverified
Commit
3a103cd3
authored
Jan 20, 2022
by
Claire
Committed by
GitHub
Jan 20, 2022
Browse files
Fix text being incorrectly pre-selected in composer textarea on /share (#17339)
Fixes #17295
parent
1e8c885e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
app/javascript/mastodon/features/compose/components/compose_form.js
...ript/mastodon/features/compose/components/compose_form.js
+2
-1
app/javascript/mastodon/features/compose/containers/compose_form_container.js
...don/features/compose/containers/compose_form_container.js
+1
-0
No files found.
app/javascript/mastodon/features/compose/components/compose_form.js
View file @
3a103cd3
...
...
@@ -60,6 +60,7 @@ class ComposeForm extends ImmutablePureComponent {
onPickEmoji
:
PropTypes
.
func
.
isRequired
,
showSearch
:
PropTypes
.
bool
,
anyMedia
:
PropTypes
.
bool
,
isInReply
:
PropTypes
.
bool
,
singleColumn
:
PropTypes
.
bool
,
};
...
...
@@ -149,7 +150,7 @@ class ComposeForm extends ImmutablePureComponent {
if
(
this
.
props
.
focusDate
!==
prevProps
.
focusDate
)
{
let
selectionEnd
,
selectionStart
;
if
(
this
.
props
.
preselectDate
!==
prevProps
.
preselectDate
)
{
if
(
this
.
props
.
preselectDate
!==
prevProps
.
preselectDate
&&
this
.
props
.
isInReply
)
{
selectionEnd
=
this
.
props
.
text
.
length
;
selectionStart
=
this
.
props
.
text
.
search
(
/
\s
/
)
+
1
;
}
else
if
(
typeof
this
.
props
.
caretPosition
===
'
number
'
)
{
...
...
app/javascript/mastodon/features/compose/containers/compose_form_container.js
View file @
3a103cd3
...
...
@@ -25,6 +25,7 @@ const mapStateToProps = state => ({
isUploading
:
state
.
getIn
([
'
compose
'
,
'
is_uploading
'
]),
showSearch
:
state
.
getIn
([
'
search
'
,
'
submitted
'
])
&&
!
state
.
getIn
([
'
search
'
,
'
hidden
'
]),
anyMedia
:
state
.
getIn
([
'
compose
'
,
'
media_attachments
'
]).
size
>
0
,
isInReply
:
state
.
getIn
([
'
compose
'
,
'
in_reply_to
'
])
!==
null
,
});
const
mapDispatchToProps
=
(
dispatch
)
=>
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment