mirror of
https://github.com/chartdb/chartdb.git
synced 2025-10-23 07:11:56 +00:00
fix(scroll): disable scroll x behavior (#795)
This commit is contained in:
@@ -83,6 +83,7 @@
|
|||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
@apply bg-background text-foreground;
|
@apply bg-background text-foreground;
|
||||||
|
overscroll-behavior-x: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-editable {
|
.text-editable {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import React, { useMemo, useState, useEffect } from 'react';
|
import React, { useMemo, useState, useEffect, useCallback } from 'react';
|
||||||
import type { DBTable } from '@/lib/domain/db-table';
|
import type { DBTable } from '@/lib/domain/db-table';
|
||||||
import { useChartDB } from '@/hooks/use-chartdb';
|
import { useChartDB } from '@/hooks/use-chartdb';
|
||||||
import { useTheme } from '@/hooks/use-theme';
|
import { useTheme } from '@/hooks/use-theme';
|
||||||
@@ -76,12 +76,15 @@ export const TableDBML: React.FC<TableDBMLProps> = ({ filteredTables }) => {
|
|||||||
}, [currentDiagram, filteredTables, toast]);
|
}, [currentDiagram, filteredTables, toast]);
|
||||||
|
|
||||||
// Determine which DBML string to display
|
// Determine which DBML string to display
|
||||||
const dbmlToDisplay = dbmlFormat === 'inline' ? inlineDbml : standardDbml;
|
const dbmlToDisplay = useMemo(
|
||||||
|
() => (dbmlFormat === 'inline' ? inlineDbml : standardDbml),
|
||||||
|
[dbmlFormat, inlineDbml, standardDbml]
|
||||||
|
);
|
||||||
|
|
||||||
// Toggle function
|
// Toggle function
|
||||||
const toggleFormat = () => {
|
const toggleFormat = useCallback(() => {
|
||||||
setDbmlFormat((prev) => (prev === 'inline' ? 'standard' : 'inline'));
|
setDbmlFormat((prev) => (prev === 'inline' ? 'standard' : 'inline'));
|
||||||
};
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CodeSnippet
|
<CodeSnippet
|
||||||
|
Reference in New Issue
Block a user