bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Added Offcanvas scroll after close option

Open Xcreen opened this issue 1 year ago • 3 comments
trafficstars

Description

I added a option scrollAfterClose to be able to disable the scrolling to the offcanvas toggler after the offcanvas is closed.

Motivation & Context

Currently after the offcanvas is closed, the body always scrolling back to the offcanvas toggler position.
When enable offcanvas bodyscrolling and add anchor-links into the offcanvas, the links dont work.

Type of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Refactoring (non-breaking change)
  • [ ] Breaking change (fix or feature that would change existing functionality)

Checklist

  • [x] I have read the contributing guidelines
  • [x] My code follows the code style of the project (using npm run lint)
  • [x] My change introduces changes to the documentation
  • [x] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [x] All new and existing tests passed

Live previews

Related issues

Closes #38070

Xcreen avatar Jun 12 '24 13:06 Xcreen

noting that this isn't about scrolling. scrolling is a side effect of focus being (correctly) set back to the element that triggered the offcanvas. so, at the very least, rename this to be about focus, not scroll.

patrickhlauke avatar Jun 17 '24 14:06 patrickhlauke

As suggested, I have changed the name of the option.

scrollAfterClose > focusAfterClose

Xcreen avatar Jul 12 '24 14:07 Xcreen

Unfortunately, this still needs tests.

XhmikosR avatar Jul 15 '24 18:07 XhmikosR