Skip to content

Commit ecaf0cd

Browse files
authored
Merge pull request #2341 from pie-framework/fix/DNAFORM-2093
fix(editable-html-tip-tap): put the bottom toolbar in normal flow DNA…
2 parents ff8c2af + 3a48c25 commit ecaf0cd

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • packages/editable-html-tip-tap/src/components

packages/editable-html-tip-tap/src/components/MenuBar.jsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,10 @@ const StyledMenuBar = (props) => {
530530
};
531531

532532
const StyledMenuBarRoot = styled('div')(() => ({
533+
// A zero-height slot the toolbar overflows out of, so the toolbar rides normal flow while the
534+
// root's geometry stays as it was.
535+
height: 0,
536+
overflow: 'visible',
533537
'& .defaultToolbar': {
534538
display: 'flex',
535539
width: '100%',
@@ -580,13 +584,16 @@ const StyledMenuBarRoot = styled('div')(() => ({
580584
color: 'var(--white)',
581585
},
582586
'& .toolbar': {
583-
position: 'absolute',
587+
// Offset from its own in-flow position: no containing block and no static position to resolve,
588+
// either of which a lockdown browser extension can get wrong as the editor grows.
589+
position: 'relative',
590+
top: '5px',
584591
zIndex: 20,
585592
cursor: 'pointer',
586593
justifyContent: 'space-between',
587594
background: 'var(--editable-html-toolbar-bg, #efefef)',
588595
minWidth: '280px',
589-
margin: '5px 0 0 0',
596+
margin: 0,
590597
padding: '2px',
591598
boxShadow:
592599
'0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)',
@@ -599,6 +606,8 @@ const StyledMenuBarRoot = styled('div')(() => ({
599606
minWidth: '265px',
600607
},
601608
'& .toolbarTop': {
609+
// Anchored to the root's top, which never depended on the editor's height.
610+
position: 'absolute',
602611
top: '-45px',
603612
},
604613
'& .toolbarRight': {

0 commit comments

Comments
 (0)