1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

POC compose using the new emoji selector

This commit is contained in:
xmflsct
2022-09-18 23:54:50 +02:00
parent 7282434e69
commit 2df23a8a2e
10 changed files with 138 additions and 245 deletions

View File

@ -44,7 +44,7 @@ const EmojisList = () => {
const contentFront = value.slice(0, selection.start)
const contentRear = value.slice(selection.end)
const spaceFront = /\s/g.test(contentFront.slice(-1)) ? '' : ' '
const spaceFront = value.length === 0 || /\s/g.test(contentFront.slice(-1)) ? '' : ' '
const spaceRear = /\s/g.test(contentRear[0]) ? '' : ' '
setValue(
@ -52,7 +52,6 @@ const EmojisList = () => {
)
const addedLength = spaceFront.length + shortcode.length + spaceRear.length
setSelection({ start: selection.start + addedLength })
ref?.current?.setNativeProps({
selection: { start: selection.start + addedLength }