Comments (4)
@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.
@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.
Once this gets added in, Loop will be able to fix the issue with the indecisive hover modal! Looks cool!
from metal-plugins.
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)
- [metal-drag-drop] Add an option to refer element instead of mouse position when hovering a target and drop something
- [metal-drag-drop] Mouse position moves away from the element when the page is fully scrolled down HOT 1
- [metal-drag-drop] Draggable elements are not clickable HOT 3
- [metal-drag-drop] Provide some CSS class to the element being dragged HOT 3
- [metal-drag-drop] Drag.toElements_ method does not support every valid selector
- [metal-uri] [question] Why replacing + character with a blank space? HOT 2
- [metal-drag-drop] Allow defining a scroll container for autoScroll
- [metal-debounce] Stop including @babel/polyfill HOT 2
- [metal-drag-drop] scroll is looping when dragging an item
- [metal-drag-drop] issue on removeAllListener
- Move metal-debounce to this repo HOT 1
- Move metal-structs to this repo
- [metal-anim
- [metal-router] using window.onbeforeunload does not work for popstate events HOT 1
- [metal-useragent] User Agent is not being detected since v2.2.0 HOT 1
- [metal-storage] Doesn't work with jsdom @ >11.12.0 HOT 2
- [metal-drag-drop] Drag event doesn't propagate original event HOT 6
- [incremental-dom-string] Possible XSS injection when rendering server-side HOT 1
- [metal-drag-drop] Placeholder is added to the target list HOT 4
- [metal-drag-drop] Incorrect hovered items when there is horizontal scroll HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metal-plugins.