Skip to content

Releases: fkhadra/react-contexify

v6.0.0

13 Nov 22:08
Compare
Choose a tag to compare

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 the Item 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 and animation constants
  • The show method exposed by the useContextMenu hook uses the same signature as contextMenu. It only accepts a single parameter now.
const {show} = useContextMenu({id: "menuId"})

// ⛔️ Before
show(e, {props: {}})

// ✅ Now
show({ event: e, props: {}})
  • The onShow and onHidden callback have been removed in favor of a single callback onVisibilityChange
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

30 Nov 19:38
Compare
Choose a tag to compare

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 removed
  • IconFont removed
  • props passed to show are no longer merged with data. More details on handling the click event on Item here
  • Menu is animated by default.

v4.0.2

26 Feb 10:32
Compare
Choose a tag to compare
  • Fix nested contextmenu provider regression #105
  • Update dev dependencies