-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Hi,
I have an accordion component at bottom of the page, I want scrolling after it open.
Is it possible to start scrolling with delay?
I try this code:
constructor(props) {
super(props);
this.state = {
showUpload: false,
};
this.anchorRef = createRef();
}showUploadBlock = () => {
this.setState(prevState => ({
showUpload: !prevState.showUpload,
}), () => {
if (this.state.showUpload) {
setTimeout(() => {
this.anchorRef.click();
}, 5);
}
});
};<Button
onClick={this.showUploadBlock}
variant="info"
size="lg"
block
>
Upload File
</Button><AnchorLink
ref={(ref) => {
this.anchorRef = ref;
}}
href="#upload"
className="invisible"
/>But ref is not working.
Metadata
Metadata
Assignees
Labels
No labels