GithubHelp home page GithubHelp logo

Comments (4)

jbalsas avatar jbalsas commented on June 24, 2024

@Robert-Frampton

Hey @kienD,

Makes sense to me. Out of curiosity, what's the workaround you guys are currently using?

Also, it seems like it would be easy to add something just to the align method, rather than messing with getAlignRegion.

For example, a param called offset which would look like {top: 2, bottom: -4}, and you could just modify bestRegion with those values here.

from metal-plugins.

jbalsas avatar jbalsas commented on June 24, 2024

@kienD

@Robert-Frampton,

We would add an offset to the side of the element that Align.align would return by adding either of the following styles to the element:

`margin-X: ${offset}px`

or

`{transform: translateX(${offset})px}`

One of the issues with this was that it possible to run into the following infinite loop:
1. The element will render near the window edge.
2. The element will try to render at a different position because it's overflowing the window.
3. The element will try to render near the edge again because it was the preferred location.

I'll look into what you mentioned and will send a PR in.

Thanks!

from metal-plugins.

jbalsas avatar jbalsas commented on June 24, 2024

@jwu910

Once this gets added in, Loop will be able to fix the issue with the indecisive hover modal! Looks cool!

from metal-plugins.

jbalsas avatar jbalsas commented on June 24, 2024

@kienD

@jwu910,

I don't think this will fix your issue with the indecisive hover modals.

@Robert-Frampton,

After reading @jwu910's comment, I realized that the implementation suggested above would probably introduce a bug where the element can render off screen if the offset is large enough and if autoBestAlign = true.

I will try to look into a way we can add and account for the offset in the suggestAlignBestRegion calculation as well.

Thanks,

from metal-plugins.

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.