Git Product home page Git Product logo

Comments (5)

webholics avatar webholics commented on August 11, 2024

Thanks for your feedback. I will look into it.

from react-positioning-portal.

webholics avatar webholics commented on August 11, 2024

If I understand your screenshot correctly your browser viewport is overflowing the monitor viewport on the right side. In other words the browser has been made larger than the space you have on your monitor. I don't think there is any way to handle this case with web standards. JS methods like getBoundingClientRect only give us the coordinates in relation to the browser viewport. Everything we do within JS and CSS basically is always related to the browser viewport not the operating system viewport.

from react-positioning-portal.

ddfridley avatar ddfridley commented on August 11, 2024

Thanks for looking at this.

The browser window is not larger than the monitor, just that the window has been moved to the right, so that some of it is off screen.

I admit I had to really search for it, but there is window.screen and window.screenLeft and window.screenTop that can be used to figure out if the window is off the screen. Also, in the case of Chrome, it is necessary to consider screen.availLeft and screen.availTop even though they are nonstandard - they are offsets so screenLeft-(screen.availLeft||0) and screenTop-(screen.availTop||0) are what you would have expected. Screen

from react-positioning-portal.

ddfridley avatar ddfridley commented on August 11, 2024

Or, maybe I am being to picky. It's just that it was one of my first test cases. Either way, I appreciate this code. We are using it in github.com/EnCiv/civil-pursuit

from react-positioning-portal.

webholics avatar webholics commented on August 11, 2024

Appreciate your feedback. Using screen would be an interesting take to solve this. I will look into it. However it could be tricky to calculate everything correctly in the positioning strategy e.g. when the browser is zoomed or with different screen pixel densities.

from react-positioning-portal.

Related Issues (4)

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.