@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/esm/index.js CHANGED
@@ -7051,7 +7051,7 @@ const MenuBar = defineComponent({
7051
7051
  activeSubmenu.value = menuKey;
7052
7052
  };
7053
7053
  const closeMenu = (e) => {
7054
- if (showMenu.value && containerRef.value && !containerRef.value.contains(e.target)) {
7054
+ if (showMenu.value && containerRef.value && !containerRef.value.contains(e.target) && mainRef.value && !mainRef.value.contains(e.target)) {
7055
7055
  showMenu.value = false;
7056
7056
  activeSubmenu.value = null;
7057
7057
  if (rafId) cancelAnimationFrame(rafId);
@@ -7171,6 +7171,11 @@ const MenuBar = defineComponent({
7171
7171
  {
7172
7172
  key: menuKey,
7173
7173
  onMouseenter: () => onMouseEnterItem(menuKey),
7174
+ onMouseleave: () => {
7175
+ if (hasSubmenu(menuKey)) {
7176
+ activeSubmenu.value = null;
7177
+ }
7178
+ },
7174
7179
  style: {
7175
7180
  position: "relative",
7176
7181
  padding: "8px 16px",