Skip to content

Commit dbebbf5

Browse files
committed
minor clean up
1 parent 38d9348 commit dbebbf5

File tree

3 files changed

+1
-36
lines changed

3 files changed

+1
-36
lines changed

packages/lexical-playground/src/themes/PlaygroundEditorTheme.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@
639639
scrollbar-width: none; /* Firefox */
640640
-ms-overflow-style: none; /* IE and Edge */
641641
width: 200px;
642+
z-index: 4;
642643
}
643644
.PlaygroundEditorTheme__contextMenu button:first-child {
644645
border-radius: 8px 8px 0px 0px;

packages/lexical-react/flow/LexicalTypeaheadMenuPlugin.js.flow

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ declare export var SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
3636
option: MenuOption,
3737
}>;
3838

39-
declare export function getScrollParent(
40-
element: HTMLElement,
41-
includeHidden: boolean,
42-
): HTMLElement | HTMLBodyElement;
43-
4439
declare export function useBasicTypeaheadTriggerMatch(
4540
trigger: string,
4641
options: {minLength?: number, maxLength?: number},

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -106,37 +106,6 @@ function isSelectionOnEntityBoundary(
106106
});
107107
}
108108

109-
// Got from https://stackoverflow.com/a/42543908/2013580
110-
export function getScrollParent(
111-
element: HTMLElement,
112-
includeHidden: boolean,
113-
): HTMLElement | HTMLBodyElement {
114-
let style = getComputedStyle(element);
115-
const excludeStaticParent = style.position === 'absolute';
116-
const overflowRegex = includeHidden
117-
? /(auto|scroll|hidden)/
118-
: /(auto|scroll)/;
119-
if (style.position === 'fixed') {
120-
return document.body;
121-
}
122-
for (
123-
let parent: HTMLElement | null = element;
124-
(parent = parent.parentElement);
125-
126-
) {
127-
style = getComputedStyle(parent);
128-
if (excludeStaticParent && style.position === 'static') {
129-
continue;
130-
}
131-
if (
132-
overflowRegex.test(style.overflow + style.overflowY + style.overflowX)
133-
) {
134-
return parent;
135-
}
136-
}
137-
return document.body;
138-
}
139-
140109
// export {useDynamicPositioning} from './shared/LexicalMenu';
141110

142111
export const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{

0 commit comments

Comments
 (0)