Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

add scrollable instead of the default scroll of the browser

Guy Ben-Aharon4cce61728291
diff --git a/src/index.css b/src/index.css
index 58c02d6c..037503f7 100644
--- a/src/index.css
+++ b/src/index.css
@@ -11,13 +11,4 @@
@apply transition-[width];
@apply duration-100;
}
-
- html {
- -ms-overflow-style: none; /* IE and Edge */
- scrollbar-width: none; /* Firefox */
- }
-
- html::-webkit-scrollbar {
- display: none;
- }
}
diff --git a/src/pages/editor-page/side-panel/relationships-section/relationships-section.tsx b/src/pages/editor-page/side-panel/relationships-section/relationships-section.tsx
index e0b51b80..84a9097e 100644
--- a/src/pages/editor-page/side-panel/relationships-section/relationships-section.tsx
+++ b/src/pages/editor-page/side-panel/relationships-section/relationships-section.tsx
@@ -7,6 +7,7 @@ import { useChartDB } from '@/hooks/use-chartdb';
import { DBRelationship } from '@/lib/domain/db-relationship';
import { useLayout } from '@/hooks/use-layout';
import { EmptyState } from '@/components/empty-state/empty-state';
+import { ScrollArea } from '@/components/scroll-area/scroll-area';
export interface RelationshipsSectionProps {}
@@ -47,18 +48,20 @@ export const RelationshipsSection: React.FC<RelationshipsSectionProps> = () => {
/>
</div>
</div>
- <div className="flex flex-col flex-1 overflow-scroll">
- {/* <ScrollArea className="h-full"> */}
- {relationships.length === 0 ? (
- <EmptyState
- title="No relationships"
- description="Create a relationship to connect tables"
- className="mt-20"
- />
- ) : (
- <RelationshipList relationships={filteredRelationships} />
- )}
- {/* </ScrollArea> */}
+ <div className="flex flex-col flex-1 overflow-hidden">
+ <ScrollArea className="h-full">
+ {relationships.length === 0 ? (
+ <EmptyState
+ title="No relationships"
+ description="Create a relationship to connect tables"
+ className="mt-20"
+ />
+ ) : (
+ <RelationshipList
+ relationships={filteredRelationships}
+ />
+ )}
+ </ScrollArea>
</div>
</section>
);
diff --git a/src/pages/editor-page/side-panel/tables-section/tables-section.tsx b/src/pages/editor-page/side-panel/tables-section/tables-section.tsx
index a5e9db90..0bf37c2e 100644
--- a/src/pages/editor-page/side-panel/tables-section/tables-section.tsx
+++ b/src/pages/editor-page/side-panel/tables-section/tables-section.tsx
@@ -8,6 +8,7 @@ import { DBTable } from '@/lib/domain/db-table';
import { useChartDB } from '@/hooks/use-chartdb';
import { useLayout } from '@/hooks/use-layout';
import { EmptyState } from '@/components/empty-state/empty-state';
+import { ScrollArea } from '@/components/scroll-area/scroll-area';
export interface TablesSectionProps {}
@@ -54,18 +55,18 @@ export const TablesSection: React.FC<TablesSectionProps> = () => {
Add Table
</Button>
</div>
- <div className="flex flex-col flex-1 overflow-scroll">
- {/* <ScrollArea className="h-full !max-w-full"> */}
- {tables.length === 0 ? (
- <EmptyState
- title="No tables"
- description="Create a table to get started"
- className="mt-20"
- />
- ) : (
- <TableList tables={filteredTables} />
- )}
- {/* </ScrollArea> */}
+ <div className="flex flex-col flex-1 overflow-hidden">
+ <ScrollArea className="h-full">
+ {tables.length === 0 ? (
+ <EmptyState
+ title="No tables"
+ description="Create a table to get started"
+ className="mt-20"
+ />
+ ) : (
+ <TableList tables={filteredTables} />
+ )}
+ </ScrollArea>
</div>
</section>
);