This commit is contained in:
Jamie Kyle 2023-04-20 10:03:43 -07:00 committed by GitHub
parent 1f2cde6d04
commit 0e490542a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
196 changed files with 2117 additions and 1217 deletions

View file

@ -431,12 +431,16 @@ export function LeftPane({
const onMouseMove = (event: MouseEvent) => {
let width: number;
const isRTL = i18n.getLocaleDirection() === 'rtl';
const x = isRTL ? window.innerWidth - event.clientX : event.clientX;
if (requiresFullWidth) {
width = Math.max(event.clientX, MIN_FULL_WIDTH);
} else if (event.clientX < SNAP_WIDTH) {
width = Math.max(x, MIN_FULL_WIDTH);
} else if (x < SNAP_WIDTH) {
width = MIN_WIDTH;
} else {
width = clamp(event.clientX, MIN_FULL_WIDTH, MAX_WIDTH);
width = clamp(x, MIN_FULL_WIDTH, MAX_WIDTH);
}
setPreferredWidth(Math.min(width, MAX_WIDTH));
@ -456,7 +460,7 @@ export function LeftPane({
document.body.removeEventListener('mouseup', stopResizing);
document.body.removeEventListener('mouseleave', stopResizing);
};
}, [isResizing, requiresFullWidth]);
}, [i18n, isResizing, requiresFullWidth]);
useEffect(() => {
if (!isResizing) {