Open NimaKaviyani opened 4 years ago
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.
I'm also curious if you can do it with this package.
Unfortunately, I did not succeed. And I did not receive an answer after a year.
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:
But ref is not working.