@jvs-milkdown/crepe 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -7053,7 +7053,7 @@ const MenuBar = vue.defineComponent({
7053
7053
  activeSubmenu.value = menuKey;
7054
7054
  };
7055
7055
  const closeMenu = (e) => {
7056
- if (showMenu.value && containerRef.value && !containerRef.value.contains(e.target)) {
7056
+ if (showMenu.value && containerRef.value && !containerRef.value.contains(e.target) && mainRef.value && !mainRef.value.contains(e.target)) {
7057
7057
  showMenu.value = false;
7058
7058
  activeSubmenu.value = null;
7059
7059
  if (rafId) cancelAnimationFrame(rafId);
@@ -7173,6 +7173,11 @@ const MenuBar = vue.defineComponent({
7173
7173
  {
7174
7174
  key: menuKey,
7175
7175
  onMouseenter: () => onMouseEnterItem(menuKey),
7176
+ onMouseleave: () => {
7177
+ if (hasSubmenu(menuKey)) {
7178
+ activeSubmenu.value = null;
7179
+ }
7180
+ },
7176
7181
  style: {
7177
7182
  position: "relative",
7178
7183
  padding: "8px 16px",