From 21a0cbcc5c5b55a530f29ba499d57307bd5f8aea Mon Sep 17 00:00:00 2001 From: Simon Rapilly <85184231+srapilly@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:01:06 +0000 Subject: [PATCH] Use onToggle with event open value --- app/javascript/mastodon/features/about/index.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/features/about/index.jsx b/app/javascript/mastodon/features/about/index.jsx index d2a0637d668..0d83da71dcf 100644 --- a/app/javascript/mastodon/features/about/index.jsx +++ b/app/javascript/mastodon/features/about/index.jsx @@ -62,11 +62,10 @@ class Section extends PureComponent { collapsed: !this.props.open, }; - handleClick = () => { + handleClick = (e) => { const { onOpen } = this.props; - const { collapsed } = this.state; - - this.setState({ collapsed: !collapsed }, () => onOpen && onOpen()); + + this.setState({ collapsed: !e.currentTarget.open }, () => onOpen && onOpen()); }; render () { @@ -74,7 +73,7 @@ class Section extends PureComponent { const { collapsed } = this.state; return ( -
+
{title}