`entry.intersectionRatio` is not exactly 1.0
See original GitHub issueDetails
- Browser and browser version: Electron 6
- OS version: Win 10
- xterm.js version: 4.9.0
Steps to reproduce
We hit a strange bug that was blocking us for a couple of days. Until we found the intersectionRatio
is sometimes near to 1.0 (like 0.99) but not exactly 1.0.
https://github.com/atom-ide-community/terminal/issues/5#issuecomment-689720693 https://github.com/atom-ide-community/terminal/issues/5
I just wanted to let you know about this behavior.
We had a condition to create xterm Element only if intersectionRatio === 1.0
which was not being triggered (this condition was to avoid https://github.com/bus-stop/x-terminal/issues/57).
Suggestion
Introduce a boolean value that shows if the intersectionRatio
is almost 1.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
IntersectionObserverEntry.intersectionRatio - Web APIs | MDN
Value. A number between 0.0 and 1.0 which indicates how much of the target element is actually visible within the root's intersection rectangle....
Read more >IntersectionObserver isIntersecting property never is false if ...
By default the threshold is 0, so the callback is called when the element enters or leaves the viewport. When you change the...
Read more >IntersectionObserverEntry.intersectionRatio - Web APIs
A number between 0.0 and 1.0 which indicates how much of the target element is actually visible within the root's intersection rectangle. More...
Read more >IntersectionObserver intersectionRatio < 1 observed
As I do that, I see an observation with intersection ratio ~=0.99 about half the time. A few significant facts: The 0.99 ratio...
Read more >A Few Functional Uses for Intersection Observer to Know ...
You might not know this, but JavaScript has stealthily accumulated quite a number of ... threshold – An array of values (between 0...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I feel like fit being called on a hidden element or one with 0 width or height shouldn’t throw an error. It should just check for that situation and return early without doing anything. I can’t see a situation where that would be a problem.
It already seems to do something similar if the terminal isn’t connected to the dom
https://github.com/xtermjs/xterm.js/blob/4e18a78c02d0bcb5b97eeeb741d5e3c0b996cdc3/addons/xterm-addon-fit/src/FitAddon.ts#L36-L38