Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kobalte ContextMenu.Sub ui-expanded not correct #19

Open
XHanL opened this issue Jul 4, 2024 · 0 comments
Open

Kobalte ContextMenu.Sub ui-expanded not correct #19

XHanL opened this issue Jul 4, 2024 · 0 comments

Comments

@XHanL
Copy link

XHanL commented Jul 4, 2024

The variants ui-expanded of Kobalte ContextMenu.Sub will follow the ui-expanded of ContextMenu, rather than being independent of each other.

I tried to modify the plugin like this, which can fix this problem, but I don't know if this will affect other parts.

function presetVariants(options: PrimitivesOptions = {}): Variant {
      ...
      return {
        matcher: matcher.slice(match[0].length),
-        selector: (s: any) => (match[1] === '-not')
-          ? `${s}[${selector}]:not(${attrGen}),:where([${selector}]:not(${attrGen})) ${s}:not(${selector})`
-        : `${s}${attrGen},:where(${attrGen}) ${s}`,
+       selector: (s: any) =>
+         match[1] === "-not" ? `${s}[${selector}]:not(${attrGen})` : `${s}${attrGen}`,
      };
    },
  };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant