Skip to content

Commit

Permalink
fix: Reduce instances of pointer over floating toolbar causing flicke…
Browse files Browse the repository at this point in the history
…ring

Increase clickable area of toolbar buttons
  • Loading branch information
tommoor committed Nov 4, 2021
1 parent 56473a6 commit eb52297
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/FloatingToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const Wrapper = styled.div<{
position: absolute;
bottom: -2px;
left: calc(50% - ${props => props.offset || 0}px);
pointer-events: none;
}
* {
Expand All @@ -221,7 +222,6 @@ const Wrapper = styled.div<{
active &&
`
transform: translateY(-6px) scale(1);
pointer-events: all;
opacity: 1;
`};
Expand Down
1 change: 1 addition & 0 deletions src/components/LinkEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ const Wrapper = styled(Flex)`
margin-left: -8px;
margin-right: -8px;
min-width: 336px;
pointer-events: all;
`;

const SearchResults = styled.ol`
Expand Down
11 changes: 11 additions & 0 deletions src/components/ToolbarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default styled.button<Props>`
padding: 0;
opacity: 0.7;
outline: none;
pointer-events: all;
position: relative;
&:first-child {
margin-left: 0;
Expand All @@ -29,5 +31,14 @@ export default styled.button<Props>`
cursor: default;
}
&:before {
position: absolute;
content: "";
top: -4px;
right: -4px;
left: -4px;
bottom: -4px;
}
${props => props.active && "opacity: 1;"};
`;

0 comments on commit eb52297

Please sign in to comment.