- Remove code casuing expensive style recalculation
This commit is contained in:
parent
51b98eed2f
commit
faeac974ca
|
|
@ -16,7 +16,8 @@ const Wrapper = styled.span<{
|
|||
background-color: ${(props) =>
|
||||
props.theme.colors.codeMirror.background.hoverState};
|
||||
position: absolute;
|
||||
bottom: ${(props) => -props.bottomOffset}px;
|
||||
bottom: ${(props) => props.bottomOffset}px;
|
||||
transform: translateY(100%);
|
||||
width: 100%;
|
||||
line-height: 13px;
|
||||
visibility: ${(props) => (props.visible ? "visible" : "hidden")};
|
||||
|
|
@ -37,15 +38,9 @@ function BindingPrompt(props: {
|
|||
editorTheme?: EditorTheme;
|
||||
}): JSX.Element {
|
||||
const promptRef = useRef<HTMLDivElement>(null);
|
||||
let bottomOffset = 30;
|
||||
const customMessage = !!props.promptMessage;
|
||||
if (promptRef.current) {
|
||||
const boundingRect = promptRef.current.getBoundingClientRect();
|
||||
bottomOffset = boundingRect.height;
|
||||
}
|
||||
if (customMessage) {
|
||||
bottomOffset = 36;
|
||||
}
|
||||
const bottomOffset = customMessage ? 6 : 0;
|
||||
|
||||
return (
|
||||
<Wrapper
|
||||
bottomOffset={bottomOffset}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user