rtl-fix address issues

This commit is contained in:
tasnim 2024-08-05 11:31:11 +03:00
parent 048704f572
commit 94a076c9bc
3 changed files with 4 additions and 4 deletions

View File

@ -1385,7 +1385,7 @@ export default function ControlPanel({
<Divider layout="vertical" margin="8px" />
<Dropdown
style={{ width: "240px" }}
position="bottomLeft"
position={isRtl(i18n.language) ? "bottomRight" : "bottomLeft"}
render={
<Dropdown.Menu
style={isRtl(i18n.language) ? { direction: "rtl" } : {}}

View File

@ -63,6 +63,7 @@ export default function TableInfo({ data }) {
<div
key={"field_" + j}
className={`cursor-pointer ${drag.draggingOverIndexList.includes(j) ? "opacity-25" : ""}`}
style={{ direction: "ltr" }}
draggable
onDragStart={() => {
setDrag((prev) => ({ ...prev, draggingElementIndex: j }));

View File

@ -23,7 +23,6 @@ import { Modal } from "@douyinfe/semi-ui";
import { useTranslation } from "react-i18next";
import { databases } from "../data/databases";
import { isRtl } from "../i18n/utils/rtl";
import i18n from "../i18n/i18n";
export default function WorkSpace() {
const [id, setId] = useState(0);
@ -51,11 +50,11 @@ export default function WorkSpace() {
setDatabase,
} = useDiagram();
const { undoStack, redoStack, setUndoStack, setRedoStack } = useUndoRedo();
const { t } = useTranslation();
const { t, i18n } = useTranslation();
const handleResize = (e) => {
if (!resize) return;
const w = e.clientX;
const w = isRtl(i18n.language) ? window.innerWidth - e.clientX : e.clientX;
if (w > 340) setWidth(w);
};