Skip to content

Commit 10d5728

Browse files
committed
minor clean up
1 parent 49293e7 commit 10d5728

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
@@ -627,6 +627,7 @@
627627
scrollbar-width: none; /* Firefox */
628628
-ms-overflow-style: none; /* IE and Edge */
629629
width: 200px;
630+
z-index: 4;
630631
}
631632
.PlaygroundEditorTheme__contextMenu button:first-child {
632633
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
@@ -107,37 +107,6 @@ function isSelectionOnEntityBoundary(
107107
});
108108
}
109109

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

143112
export const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{

0 commit comments

Comments
 (0)