Releases: fkhadra/react-contexify
Releases · fkhadra/react-contexify
v6.0.0
Release notes
🚀 Features
- Allow disabling boundaries check
- Allow to disable preventDefault on key down
- Add support for hidden property to Separator
- Add visual feedback when the item is clicked
- Easy customization thanks to CSS variables. Check out the theme builder
- Keyboard shortcut made easy! A
keyMatcher
prop has been added to theItem
component. See it in action - Size decreased from 3.4K to 3.1K 🎉
🕷 Bugfixes
- fix close animation flash #218 #219
- fix boundaries check when repositioning menu #163
- fix submenu offscreen #203
💥 Breaking changes
- removal of
theme
andanimation
constants - The
show
method exposed by theuseContextMenu
hook uses the same signature ascontextMenu
. It only accepts a single parameter now.
const {show} = useContextMenu({id: "menuId"})
// ⛔️ Before
show(e, {props: {}})
// ✅ Now
show({ event: e, props: {}})
- The
onShow
andonHidden
callback have been removed in favor of a single callbackonVisibilityChange
const handleVisibilityChange = (isVisible: boolean) => {
console.log(isVisible)
}
<Menu id="menuId" onVisibilityChange={handleVisibilityChange}>
<Item>Item 1</Item>
</Menu>
- Shorten path to import the stylesheet
// ⛔️ Before
import "react-contexify/dist/ReactContexify.css"
// ✅ Now
import "react-contexify/ReactContexify.css"
-
Drop support for webpack 4 (CRA v4)
-
css classes have been renamed, please check how to style for the list
v5.0.0
Release notes
🚀 Features
- add
useContextMenu
hook - support custom position. close #94
- possibility to hide an Item. close #139
- possibility to prevent the menu from closing on item click. close #136
- possibility to pass any HTML attribute (id, data-attribute, etc...). close #103
- support keyboard navigation. close #24
- menu can be mounted anywhere using react portal. close #138
- the library is now tree-shakeable
🛠 Misc
- switched to tsdx for build
- fully tested with cypress
- size reduction 💪. From 16.3kB to 9kB (3.4 gzipped)
- new documentation!
- animation and style reworked
🔥Breaking changes
MenuProvider
removedIconFont
removedprops
passed toshow
are no longer merged withdata
. More details on handling the click event onItem
hereMenu
is animated by default.