Comments (4)
Hi Rijk,
Again, good question!
It's true that defining possibleAnchors
has no effect on the anchor priority.
There is, however, some logic / rationale to which determines the anchor priority dynamically. This function looks at anchor
(the 'preferred' anchor), preferX
, preferY
and possibleAnchors
, and outputs a list of anchors sorted by priority. It than tries to find the first one that 'fits'.
This prioritising is currently implicit, which I think will work for many use-cases (together with preferX/Y
). However, there may be use-cases where you want to prioritise the anchors explicitly.
How would you define such behavior? Right now, possibleAnchors
just sets the available anchors. I don't think that this prop should do 2 things. Maybe an extra prop: anchorPriority
? Or maybe a flag respectAnchorPriority
that 'respects' / overrides the priority based on possibleAnchors
? 😅
What do you think?
from react-laag.
If you ask me, this is not important enough to add another property for. I thought it could 'just work' like this, and that would be pretty nice. In this case I wanted BOTTOM_LEFT
/BOTTOM_RIGHT
to be used only as a last resort. It seems preferX
/preferY
cannot really help here.
But yeah, it is not super important, and if there's other considerations here I understand.
from react-laag.
I do think your wish is legitimate, but as a consequence it add more complexity. Will keep this open for now and see if others are running into the same issue as well...
from react-laag.
I'll close this as it's not that important.
from react-laag.
Related Issues (20)
- How to pass a clientRect in v2? HOT 1
- [BUG] Placement of tooltip in safari when zoomed in is not correct
- Tooltip flickers while hovering on the button
- [BUG] Minimal get started example does not work properly
- [FEATURE] add possibility to interact with elements in tooltip when using "UseHover" hook HOT 2
- work with react-transition-group , sometimes will flashing before the animation starts
- [BUG] tooltip created with react-laag not working when called from a modal created with react-modal
- [BUG] State updates on unmounted components in JsDom HOT 1
- migrating v1 to v2 ToggleLayerProps open function HOT 3
- [BUG] shadow DOM not working via environment parameter
- [BUG] onMouseLeave event not firing when mouse is moved quickly in Firefox HOT 2
- [BUG] - Popover not sticking to div element on Google Maps (might not be bug)
- [BUG] React-18 Support HOT 3
- [BUG] Layers flashing at old position before getting displayed at correct position HOT 5
- Does not show tooltip in full screen mode HOT 1
- How do you handle cases where a modal is shown from clicking in a layer HOT 2
- [BUG] onDisappear is triggers when we render component with react-testing-library
- [BUG]: Hydration fails with nextjs app router HOT 2
- [BUG] using react-laag in a child window via React portals renders in the parent window
- [BUG] Tooltips are not closing when the hovering is too fast.
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 react-laag.