Keep Elements in View!
This simple repo keeps a floating element from wondering off your view. below is an example of its use. Should you have an issue feel free to report it and I'll be more than happy to look into for you.
Usage
; // or const correctPosition = require('keep-element-in-view'); // pass an HTMLElement and position will be auto corrected // null will set the parent to document.body // pass in a coordinates object and have corrected coordinates returned
returned coordinates
left: String top: String width: String height: String
Use by passing in an element
; // or const correctPosition = require('keep-element-in-view'); window