Skip to content

开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.

fix(text): allow scroll to show all text (#156)

pubuzhixing8e08b2342559d
diff --git a/packages/react-text/src/styles/index.scss b/packages/react-text/src/styles/index.scss
index acc8739..2e3aa54 100644
--- a/packages/react-text/src/styles/index.scss
+++ b/packages/react-text/src/styles/index.scss
@@ -1,11 +1,20 @@
+.plait-board-container {
+ .text {
+ foreignObject {
+ overflow-x: auto;
+ &::-webkit-scrollbar {
+ display: none;
+ }
+ scrollbar-width: none;
+ }
+ }
+}
+
.plait-text-container {
font-size: 14px;
min-height: 20px;
line-height: 20px;
display: block;
- white-space: pre-wrap;
- white-space: break-spaces;
- word-break: break-all;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft Yahei', 'Hiragino Sans GB', Arial, sans-serif;
}
diff --git a/packages/react-text/src/text.tsx b/packages/react-text/src/text.tsx
index 3976359..192706e 100644
--- a/packages/react-text/src/text.tsx
+++ b/packages/react-text/src/text.tsx
@@ -110,6 +110,7 @@ export const Text: React.FC<TextComponentProps> = (
}
}}
onKeyDown={onKeyDown}
+ style={{ whiteSpace: 'nowrap' }}
/>
</Slate>
);