fix: disable global scrollbars and reposition search component to the left edge of the editor

This commit is contained in:
taDuc
2026-05-26 17:28:09 +07:00
parent cdf3323d77
commit 5a0e77ebb8
3 changed files with 14 additions and 4 deletions
+10 -1
View File
@@ -2935,6 +2935,15 @@ function EditorPageContent() {
return (
<div style={{ display: "flex", minHeight: "100vh" }}>
<style>{`
html, body {
overflow: hidden !important;
scrollbar-width: none !important;
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
display: none !important;
}
`}</style>
{!isReplayEditMode && !isAnyPreviewMode ? (
<>
<Editor
@@ -3058,7 +3067,7 @@ function EditorPageContent() {
onFocusPlace={handleFocusPresentPlace}
onFocusHistoricalGeometry={handleFocusHistoricalGeometry}
onClearFocus={clearPresentPlaceFocus}
rightOffset={isReplayPreviewWikiSidebarOpen ? previewSidebarWidth + 48 : 18}
leftOffset={18}
/>
) : null}
{isReplayPreviewMode ? (
@@ -62,6 +62,7 @@ export default function BackgroundLayersPanel({
return (
<aside
className="no-scrollbar"
style={{
width,
background: "#111827",
@@ -34,7 +34,7 @@ type Props = {
onFocusPlace: (place: PresentPlaceSelection) => void;
onFocusHistoricalGeometry: (payload: HistoricalGeometryFocusPayload) => void;
onClearFocus: () => void;
rightOffset?: number;
leftOffset?: number;
};
export default function PresentPlaceSearch({
@@ -42,7 +42,7 @@ export default function PresentPlaceSearch({
onFocusPlace,
onFocusHistoricalGeometry,
onClearFocus,
rightOffset = 18,
leftOffset = 18,
}: Props) {
const [mode, setMode] = useState<SearchMode>("present");
const [query, setQuery] = useState("");
@@ -280,7 +280,7 @@ export default function PresentPlaceSearch({
style={{
position: "absolute",
top: 10,
right: rightOffset,
left: leftOffset,
zIndex: 18,
width: "min(392px, calc(100vw - 36px))",
pointerEvents: "auto",