This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
[Glitch] Update state when opened dropdown is unmounted
Port
dcd3544d15
to glitch-soc
closed-social-glitch-2
Thibaut Girka
5 years ago
committed by
ThibG
parent
8aa58e34bb
commit
fce248810b
1 changed files
with
6 additions
and
0 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
app/javascript/flavours/glitch/components/dropdown_menu.js
+ 6
- 0
app/javascript/flavours/glitch/components/dropdown_menu.js
View File
@ -225,6 +225,12 @@ export default class Dropdown extends React.PureComponent {
return
this
.
target
;
return
this
.
target
;
}
}
componentWillUnmount
=
(
)
=>
{
if
(
this
.
state
.
id
===
this
.
props
.
openDropdownId
)
{
this
.
handleClose
(
)
;
}
}
render
(
)
{
render
(
)
{
const
{
icon
,
items
,
size
,
ariaLabel
,
disabled
,
dropdownPlacement
,
openDropdownId
}
=
this
.
props
;
const
{
icon
,
items
,
size
,
ariaLabel
,
disabled
,
dropdownPlacement
,
openDropdownId
}
=
this
.
props
;
const
open
=
this
.
state
.
id
===
openDropdownId
;
const
open
=
this
.
state
.
id
===
openDropdownId
;
Write
Preview
Loading…
Cancel
Save