Skip to content
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

[QUESTION] How to add offset from the focusing element for shepherd-content #2282

Closed
CrazyNoodl opened this issue Mar 13, 2023 · 3 comments
Closed

Comments

@CrazyNoodl
Copy link

Hello,
Maybe there is a better way to add a custom margin for the description modal?
image

I did this by changing the styles, but the arrow's position was wrong
image

@CrazyNoodl
Copy link
Author

after a few hours of investigations code and documentation, i found a solution
we should add this option in defaultStepOptions in tourOptions

import { offset } from '@floating-ui/dom';

floatingUIOptions: { middleware: [offset(10)], },

https://floating-ui.com/docs/offset

@vesper8
Copy link

vesper8 commented Mar 23, 2023

@RobbieTheWagner

Can you please update the documentation?

https://shepherdjs.dev/docs/tutorial-04-cookbook.html

It says

floatingUIOptions: {
  middlewares: [offset({ mainAxis: 0, crossAxis: 12 })]
}

But there's a typo and it should be

floatingUIOptions: {
  middleware: [offset({ mainAxis: 0, crossAxis: 12 })]
}

It's also not so obvious that you have to import { offset } from '@floating-ui/dom'; and that the above goes inside defaultStepOptions

Thanks

@RobbieTheWagner
Copy link
Member

The typo with middleware has been updated. floatingUIOptions is listed in the step options https://shepherdjs.dev/docs/Step.html, so it goes in either the step or defaultStepOptions. I will update it to make it more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants