mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +03:00
Fix sticky on Edge + IE11
This commit is contained in:
parent
c17178f28f
commit
6d7fd547b1
|
@ -11,7 +11,7 @@ describe('Standalone bundle test', function() {
|
|||
cy
|
||||
.visit('e2e/standalone.html')
|
||||
.get('.menu-content li')
|
||||
.click({ multiple: true });
|
||||
.click({ multiple: true, force: true });
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -27,7 +27,7 @@ describe('Standalone bundle test', function() {
|
|||
cy
|
||||
.visit('e2e/standalone.html')
|
||||
.get('.menu-content li')
|
||||
.click({ multiple: true });
|
||||
.click({ multiple: true, force: true });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -19,17 +19,17 @@ export interface RedocProps {
|
|||
};
|
||||
}
|
||||
|
||||
const stickyfill = Stickyfill();
|
||||
export class Redoc extends React.Component<RedocProps> {
|
||||
stickyfill = Stickyfill();
|
||||
stickyElement: Element;
|
||||
|
||||
componentDidMount() {
|
||||
this.props.store.menu.updateOnHash();
|
||||
this.stickyfill.add(this.stickyElement);
|
||||
stickyfill.add(this.stickyElement);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.stickyfill.remove(this.stickyElement);
|
||||
stickyfill.remove(this.stickyElement);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -39,7 +39,7 @@ export class Redoc extends React.Component<RedocProps> {
|
|||
<RedocWrap className="redoc-wrap">
|
||||
<StickySidebar
|
||||
className="menu-content"
|
||||
ref={el => {
|
||||
innerRef={el => {
|
||||
this.stickyElement = el;
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -34,7 +34,7 @@ export const RedocWrap = styled.div`
|
|||
`;
|
||||
|
||||
export const StickySidebar = styled.div`
|
||||
min-width: ${props => props.theme.menu.width};
|
||||
width: ${props => props.theme.menu.width};
|
||||
background-color: ${props => props.theme.menu.backgroundColor};
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
|
@ -42,7 +42,7 @@ export const StickySidebar = styled.div`
|
|||
|
||||
transform: translateZ(0);
|
||||
|
||||
max-height: 100vh;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
position: -webkit-sticky;
|
||||
top: 0;
|
||||
|
@ -51,4 +51,5 @@ export const StickySidebar = styled.div`
|
|||
export const ApiContent = styled.div`
|
||||
z-index: 10;
|
||||
position: relative;
|
||||
width: calc(100% - ${props => props.theme.menu.width});
|
||||
`;
|
||||
|
|
Loading…
Reference in New Issue
Block a user