mirror of
https://github.com/outline/outline.git
synced 2026-12-05 10:45:07 +03:00
fix: Collection overview with a table scrolls sideways on mobile (#14895)
* fix: Collection overview with a table scrolls sideways on mobile * fix: Table scroll shadow does not hide the top border past the table edge * fix: Table scroll shadow covers the column grips past the table edge
This commit is contained in:
1 parent
c00a7a4c8d
commit
30bdd0cca4
2 files changed
+19
-3
No files matched your search
@@ -6,6 +6,7 @@ import { toast } from "sonner";
|
||||
import styled from "styled-components";
|
||||
import { richExtensions } from "@shared/editor/nodes";
|
||||
import { s } from "@shared/styles";
|
||||
import { breakpoint } from "@shared/styles/breakpoint";
|
||||
import { ProsemirrorDataHelper } from "@shared/utils/ProsemirrorDataHelper";
|
||||
import { CollectionValidation } from "@shared/validations";
|
||||
import type Collection from "~/models/Collection";
|
||||
@@ -89,7 +90,7 @@ function Overview({ collection, readOnly }: Props) {
|
||||
{collections.isSaving && <LoadingIndicator />}
|
||||
{(can.update || readOnly) && (
|
||||
<Suspense fallback={<Placeholder>Loading…</Placeholder>}>
|
||||
<div>
|
||||
<EditorWrapper>
|
||||
<Editor
|
||||
defaultValue={collection.data}
|
||||
onChange={handleSave}
|
||||
@@ -103,13 +104,22 @@ function Overview({ collection, readOnly }: Props) {
|
||||
editorStyle={editorStyle}
|
||||
/>
|
||||
<div ref={childRef} />
|
||||
</div>
|
||||
</EditorWrapper>
|
||||
</Suspense>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// Adds to the page padding on mobile so the 32px editor gutter fits, as in documents.
|
||||
const EditorWrapper = styled.div`
|
||||
padding: 0 16px;
|
||||
|
||||
${breakpoint("tablet")`
|
||||
padding: 0;
|
||||
`};
|
||||
`;
|
||||
|
||||
const Placeholder = styled(Text)`
|
||||
color: ${s("placeholder")};
|
||||
cursor: text;
|
||||
|
||||
@@ -3031,7 +3031,7 @@ th:has(> .${EditorStyleHelper.tableFilterButton}.active) {
|
||||
.${EditorStyleHelper.tableShadowRight}::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: -1em;
|
||||
width: 32px;
|
||||
@@ -3041,6 +3041,12 @@ th:has(> .${EditorStyleHelper.tableFilterButton}.active) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* also covers the column grips above the table */
|
||||
.${EditorStyleHelper.tableShadowLeft}:has(.${EditorStyleHelper.tableGripColumn})::before,
|
||||
.${EditorStyleHelper.tableShadowRight}:has(.${EditorStyleHelper.tableGripColumn})::after {
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
.${EditorStyleHelper.tableShadowLeft}::before {
|
||||
left: -${EditorStyleHelper.padding}px;
|
||||
right: auto;
|
||||
|
||||
Reference in new issue
Block a user