Skip to content

Commit 00bff7c

Browse files
authored
fix: Using a menu both triggered by a button and by right-click (#791)
1 parent f08662b commit 00bff7c

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Reactist follows [semantic versioning](https://semver.org/) and doesn't introduce breaking changes (API-wise) in minor or patch releases. However, the appearance of a component might change in a minor or patch release so keep an eye on redesigns and make sure your app still looks and feels like you expect it.
44

5+
# v21.1.1
6+
7+
- [Fix] Using a menu both triggered by a button and by right-click.
8+
59
# v21.1.0
610

711
- [Feat] The `Prose` component now supports links applied to inline code.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"email": "henning@doist.com",
77
"url": "http://doist.com"
88
},
9-
"version": "21.1.0",
9+
"version": "21.1.1",
1010
"license": "MIT",
1111
"homepage": "https://github.com/Doist/reactist#readme",
1212
"repository": {

src/menu/menu.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ function Menu({ children, onItemSelect, ...props }: MenuProps) {
7676
...props,
7777
})
7878

79+
React.useEffect(() => {
80+
if (!state.open) handleAnchorRectChange(null)
81+
}, [state.open])
82+
7983
const handleItemSelect = React.useCallback(
8084
function handleItemSelect(value: string | null | undefined) {
8185
if (onItemSelect) onItemSelect(value)

0 commit comments

Comments
 (0)