Code Monkey home page Code Monkey logo

Comments (5)

kuus avatar kuus commented on September 25, 2024 1

@andy-hook yes for my desired behaviour it was enough to do onPointerLeave={e => e.preventDefault()}, I found it out by trial and error after having already opened this issue, thanks for your help.
Maybe the docs could add that behaviour or maybe it's just an edge case need not to be documented, don't know :).
thanks for the quick feedback @benoitgrelard

from primitives.

benoitgrelard avatar benoitgrelard commented on September 25, 2024

@andy-hook this seems strange to me, the docs do show the DismissableLayer props are here on content, but I wonder if it's a mistake. Usually we hide a combination of those behind modality and don't allow direct access to those props. It seems like potentially this wasn't considered here and we just ended up documenting things as they are?

from primitives.

andy-hook avatar andy-hook commented on September 25, 2024

I don't think we've implemented the modality pattern for this component yet.

The Content should stay open when the mouse pointer leaves the Content area

Perhaps unintuitive given the current documentation but this can be achieved by preventing default inside onPointerEnter onPointerLeave:
https://codesandbox.io/p/sandbox/navigation-menu-on-click-duwvgn?file=%2FApp.js%3A358%2C1-360%2C1

@kuus is that the interaction you are trying to achieve?

from primitives.

benoitgrelard avatar benoitgrelard commented on September 25, 2024

I mean I'm not sure modality even makes sense for a component like this, because if the content was modal, you wouldn't be able to interact with the other items in the top-level.

So I'm inclined to say that the solution here is to hardcode those props to formalize the non-modal nature of it and thus remove those props from the docs.

from primitives.

andy-hook avatar andy-hook commented on September 25, 2024

So I'm inclined to say that the solution here is to hardcode those props to formalize the non-modal nature of it and thus remove those props from the docs.

I agree with this.

The Content should stay open when the mouse pointer leaves the Content area

Hopefully the suggested solution in my comment is still helpful for this specific need however.

from primitives.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.