Middleware deduping
About
This might be a controversial (and breaking) change, but instead of overriding middlewares, I think the step middleware should always win. Feel free to close this PR or message me to make changes.
Take this example:
const defaultStepOptions = {
floatingUIOptions: {
middleware: [offset({ crossAxis: 32 })]
}
};
const stepOptions = {
floatingUIOptions: {
middleware: [offset({ crossAxis: -32 })]
}
}
To override defaultStepOptions you need equal negative spacing and sync these two numbers every time the default changes (or have a constant)
With this PR:
const defaultStepOptions = {
floatingUIOptions: {
middleware: [offset({ crossAxis: 32 })]
}
};
const stepOptions = {
floatingUIOptions: {
middleware: [offset({ crossAxis: 0 })]
}
}
The step offset middleware overrides the default step middleware
The latest updates on your projects. Learn more about Vercel for Git āļø
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| shepherd-docs | ā Ready (Inspect) | Visit Preview | š¬ Add feedback | Oct 16, 2024 8:37am |
| shepherd-landing | ā Ready (Inspect) | Visit Preview | š¬ Add feedback | Oct 16, 2024 8:37am |
@patrikholcak is attempting to deploy a commit to the shipshapecode Team on Vercel.
A member of the Team first needs to authorize it.
@patrikholcak we have been talking about this recently and I recently released a change that changes the ordering, so that a dup added in would run last, but that still could have issues. This would be onus on the user to make sure they still have sane defaults when going down this path, but does give the most control.
@patrikholcak docs failed to build due to this error
Rebased and updated. I also updated a step test which was failing due to the changes in dfb7d74. Iām not sure the test is relevant now, can probably be removed altogether :shrug: