-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting order/hierarchy of modifiers #1094
Comments
Have you checked the |
Good idea but same effect when using flip as {
name: 'flip',
requires: ['preventOverflow'],
options: {
fallbackPlacements: ['right', 'left', 'top', 'bottom'],
},
} The |
|
Nope, I tried that as well. That would just be required dependencies that would influence the functionality of a given modifier if it existed. I am looking to control the order of the governing modifier, not necessarily when it was executed. Somewhere in the code |
AFAIK Alternatively you may override the If this isn't helpful, I think I'll need a small repro to better understand what are you looking for. |
I haven't looked at the code but I would assume it is somewhat iterative. And may be required to change this in the Current flow
Expected flow
|
Yeah I played with the |
Is the current flow I described above correct? Such that one modifier finishes executing before another takes over, provided all the |
The |
Ok good to know. But even though it resets the update cycle it appears to be executing Thanks for the information, I'll try to put up a repro in the next few days as well as take a look into how popper is executing the modifiers. |
Honestly the behavior shown in your second clip should be the one provided by Popper out of the box, if that's not the case I'd consider that a bug. I'll wait for your repro so that we can verify it. |
The main difference between the two clips is the Either way, I'll ping you when I have a repro. |
It's this #1011 - you don't want to check |
No combination of |
Yeah because the feature isn't implemented yet 😅 but it looks like there's a use case for it so we should add it |
lol 🤣 sorry I missed that 😅. Yeah, that'd be spectacular! |
@nickofthyme May you confirm that PR addresses your problem please? |
@FezVrasta with your latest changes, setting Thanks for the quick response! When do you expect to publish |
now 😛 |
Feature description
Provide a way to set a hierarchy or order for modifiers. As far as I can tell looking through the docs, this is not possible and the order of the
modifiers
array is not respected.This may only pertain to some modifiers as some are independent of others or don't perform conditional changes such as
offset
.This could be added by respecting the array order or adding
order
prop onTModifier
such as below.It seems this logic would have to go in the core but I'm not sure if this could be implemented in the modifiers themselves.
Backstory
I am using
popperjs
to display a tooltip for a chart at a given cursor position which I am calculating, which is the blue element in the screenshots (aka theanchorRef
).It is working amazingly! However, I came across a case where I would like the
preventOverflow
modifier to take precedence over theflip
modifier.These are the options I am passing to
createPopper
The issue is that I want
bottom
andtop
to befallbackPlacements
, which causesflip
to set the placement tobottom
even thoughpreventOverflow
would have positioned the tooltip inside the boundary. So this is what I actually get with the setup above.What I would like to see is this. Where at the top
preventOverflow
pushes the tooltip down to stay inside the boundary. And on the far right,flip
changes placement toleft
andpreventOverflow
still pushes down at the top. SopreventOverflow
takes priority overflip
, but in cases where a flip is required, it still performs the flip, such as on the far right.Why should this feature be part of the Popper's core?
popperjs
and modifiersThe text was updated successfully, but these errors were encountered: