Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
1d2616b7
Commit
1d2616b7
authored
7 years ago
by
Sorin Davidoi
Committed by
Eugen Rochko
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(emojis): Handle multipoint emojis (e.g. country flags) (#4221)
parent
d4b097a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/javascript/mastodon/features/compose/components/compose_form.js
+1
-1
1 addition, 1 deletion
...ript/mastodon/features/compose/components/compose_form.js
app/javascript/mastodon/reducers/compose.js
+1
-1
1 addition, 1 deletion
app/javascript/mastodon/reducers/compose.js
with
2 additions
and
2 deletions
app/javascript/mastodon/features/compose/components/compose_form.js
+
1
−
1
View file @
1d2616b7
...
...
@@ -136,7 +136,7 @@ export default class ComposeForm extends ImmutablePureComponent {
handleEmojiPick
=
(
data
)
=>
{
const
position
=
this
.
autosuggestTextarea
.
textarea
.
selectionStart
;
const
emojiChar
=
String
.
fromCodePoint
(
parseInt
(
data
.
uni
code
,
16
));
const
emojiChar
=
data
.
unicode
.
split
(
'
-
'
).
map
(
code
=>
String
.
fromCodePoint
(
parseInt
(
code
,
16
))
).
join
(
''
)
;
this
.
_restoreCaret
=
position
+
emojiChar
.
length
+
1
;
this
.
props
.
onPickEmoji
(
position
,
data
);
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/reducers/compose.js
+
1
−
1
View file @
1d2616b7
...
...
@@ -118,7 +118,7 @@ const insertSuggestion = (state, position, token, completion) => {
};
const
insertEmoji
=
(
state
,
position
,
emojiData
)
=>
{
const
emoji
=
String
.
fromCodePoint
(
parseInt
(
emojiData
.
unicode
,
16
)
);
const
emoji
=
emojiData
.
unicode
.
split
(
'
-
'
).
map
(
code
=>
String
.
fromCodePoint
(
parseInt
(
code
,
16
))).
join
(
''
);
return
state
.
withMutations
(
map
=>
{
map
.
update
(
'
text
'
,
oldText
=>
`
${
oldText
.
slice
(
0
,
position
)}${
emoji
}
${
oldText
.
slice
(
position
)}
`
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment