Fix composer emoji picker hidden for RTL languages
This commit is contained in:
parent
32e5ac128b
commit
be5ac3a1e0
2 changed files with 7 additions and 1 deletions
|
@ -55,6 +55,8 @@ export const EmojiButton = React.memo(function EmojiButtonInner({
|
||||||
recentEmojis,
|
recentEmojis,
|
||||||
variant = EmojiButtonVariant.Normal,
|
variant = EmojiButtonVariant.Normal,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
|
const isRTL = i18n.getLocaleDirection() === 'rtl';
|
||||||
|
|
||||||
const [open, setOpen] = React.useState(false);
|
const [open, setOpen] = React.useState(false);
|
||||||
const buttonRef = React.useRef<HTMLButtonElement | null>(null);
|
const buttonRef = React.useRef<HTMLButtonElement | null>(null);
|
||||||
const popperRef = React.useRef<HTMLDivElement | null>(null);
|
const popperRef = React.useRef<HTMLDivElement | null>(null);
|
||||||
|
@ -164,7 +166,7 @@ export const EmojiButton = React.memo(function EmojiButtonInner({
|
||||||
</Reference>
|
</Reference>
|
||||||
{open ? (
|
{open ? (
|
||||||
<div ref={popperRef}>
|
<div ref={popperRef}>
|
||||||
<Popper placement="top-start" strategy="fixed">
|
<Popper placement={isRTL ? 'top-end' : 'top-start'} strategy="fixed">
|
||||||
{({ ref, style }) => (
|
{({ ref, style }) => (
|
||||||
<EmojiPicker
|
<EmojiPicker
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|
|
@ -82,6 +82,8 @@ export const EmojiPicker = React.memo(
|
||||||
}: Props,
|
}: Props,
|
||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
|
const isRTL = i18n.getLocaleDirection() === 'rtl';
|
||||||
|
|
||||||
const [firstRecent] = React.useState(recentEmojis);
|
const [firstRecent] = React.useState(recentEmojis);
|
||||||
const [selectedCategory, setSelectedCategory] = React.useState<Category>(
|
const [selectedCategory, setSelectedCategory] = React.useState<Category>(
|
||||||
categories[0]
|
categories[0]
|
||||||
|
@ -445,6 +447,8 @@ export const EmojiPicker = React.memo(
|
||||||
height={height}
|
height={height}
|
||||||
columnCount={COL_COUNT}
|
columnCount={COL_COUNT}
|
||||||
columnWidth={38}
|
columnWidth={38}
|
||||||
|
// react-virtualized Grid default style has direction: 'ltr'
|
||||||
|
style={{ direction: isRTL ? 'rtl' : 'ltr' }}
|
||||||
rowHeight={getRowHeight}
|
rowHeight={getRowHeight}
|
||||||
rowCount={rowCount}
|
rowCount={rowCount}
|
||||||
cellRenderer={cellRenderer}
|
cellRenderer={cellRenderer}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue