Fix NavSidebar resize for RTL languages
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
7a182636d2
commit
cea5685aad
1 changed files with 3 additions and 1 deletions
|
@ -79,6 +79,7 @@ export function NavSidebar({
|
|||
title,
|
||||
otherTabsUnreadStats,
|
||||
}: NavSidebarProps): JSX.Element {
|
||||
const isRTL = i18n.getLocaleDirection() === 'rtl';
|
||||
const [dragState, setDragState] = useState(DragState.INITIAL);
|
||||
|
||||
const [preferredWidth, setPreferredWidth] = useState(() => {
|
||||
|
@ -102,7 +103,8 @@ export function NavSidebar({
|
|||
setDragState(DragState.DRAGEND);
|
||||
},
|
||||
onMove(event) {
|
||||
const { deltaX, shiftKey, pointerType } = event;
|
||||
const { shiftKey, pointerType } = event;
|
||||
const deltaX = isRTL ? -event.deltaX : event.deltaX;
|
||||
const isKeyboard = pointerType === 'keyboard';
|
||||
const increment = isKeyboard && shiftKey ? 10 : 1;
|
||||
setPreferredWidth(prevWidth => {
|
||||
|
|
Loading…
Add table
Reference in a new issue