Skip to content

Commit

Permalink
fix collision of popovers in annotation settings when scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-lemeur committed Sep 30, 2024
1 parent b608d14 commit 5b092be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/renderer/assets/styles/components/combobox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
cursor: pointer;
color: var(--color-primary);
position: relative;
transition: 100ms;
text-wrap: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/reader/components/ReaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ const AnnotationList: React.FC<{ annotationUUIDFocused: string, resetAnnotationU
</button>
</Popover.Trigger>
<Popover.Portal>
<Popover.Content collisionPadding={{ top: 200, bottom: 100 }} avoidCollisions alignOffset={-10} align="end" hideWhenDetached={true} sideOffset={5} className={stylesAnnotations.annotations_sorting_container} style={{ maxHeight: Math.round(window.innerHeight / 2)}}>
<Popover.Content collisionBoundary={document.getElementById('settings_content')} avoidCollisions alignOffset={-10} align="end" hideWhenDetached sideOffset={5} className={stylesAnnotations.annotations_sorting_container} style={{ maxHeight: Math.round(window.innerHeight / 2)}}>
<Popover.Arrow className={stylesDropDown.PopoverArrow} aria-hidden style={{ fill: "var(--color-extralight-grey)" }} />
<ListBox
selectedKeys={sortType}
Expand Down Expand Up @@ -920,7 +920,7 @@ const AnnotationList: React.FC<{ annotationUUIDFocused: string, resetAnnotationU
</button>
</Popover.Trigger>
<Popover.Portal>
<Popover.Content collisionPadding={{ top: 200, bottom: 100 }} avoidCollisions alignOffset={-10} align="end" hideWhenDetached sideOffset={5} className={stylesAnnotations.annotations_filter_container} style={{ maxHeight: Math.round(window.innerHeight / 2) }}>
<Popover.Content collisionBoundary={document.getElementById('settings_content')} avoidCollisions alignOffset={-10} align="end" hideWhenDetached sideOffset={5} className={stylesAnnotations.annotations_filter_container} style={{ maxHeight: Math.round(window.innerHeight / 2) }}>
<Popover.Arrow className={stylesDropDown.PopoverArrow} aria-hidden style={{ fill: "var(--color-extralight-grey)" }} />
<TagGroup
selectionMode="multiple"
Expand Down Expand Up @@ -2172,6 +2172,7 @@ export const ReaderMenu: React.FC<IBaseProps> = (props) => {
</Tabs.List>
}
<div className={stylesSettings.settings_content}
id="settings_content"
style={{ marginTop: dockedMode && "0" }}>
<Tabs.Content value="tab-toc" tabIndex={-1} id={"readerMenu_tabs-tab-toc"} className="R2_CSS_CLASS__FORCE_NO_FOCUS_OUTLINE">
<TabHeader />
Expand Down Expand Up @@ -2208,7 +2209,7 @@ export const ReaderMenu: React.FC<IBaseProps> = (props) => {
<SVG ariaHidden svg={OptionsIcon} title={__("reader.annotations.annotationsOptions")} />
</Popover.Trigger>
<Popover.Portal>
<Popover.Content collisionPadding={{ top: 180, bottom: 100 }} avoidCollisions alignOffset={-10} /* hideWhenDetached */ sideOffset={5} className={stylesAnnotations.annotations_filter_container} hideWhenDetached>
<Popover.Content collisionBoundary={document.getElementById("settings_content")} avoidCollisions alignOffset={-10} /* hideWhenDetached */ sideOffset={5} className={stylesAnnotations.annotations_filter_container} hideWhenDetached>
<div className={stylesAnnotations.annotations_checkbox}>
<input type="checkbox" id="advancedAnnotations" className={stylesGlobal.checkbox_custom_input} name="advancedAnnotations" checked={serialAnnotator} onChange={advancedAnnotationsOnChange} />
<label htmlFor="advancedAnnotations" className={stylesGlobal.checkbox_custom_label}>
Expand Down

0 comments on commit 5b092be

Please sign in to comment.