Giter Site home page Giter Site logo

Issue with Select2.js about asscroll HOT 3 CLOSED

jbarkun avatar jbarkun commented on August 18, 2024
Issue with Select2.js

from asscroll.

Comments (3)

ashthornton avatar ashthornton commented on August 18, 2024 1

Hi @jbarkun, that is a very interesting issue! Thanks for raising it.

I have some ideas about how to fix this internally but as a temporary fix you should be able to call .disable() on your ASScroll instance when a Select2 is opened. It's been a while since I used Select2 but I think I remember there being open/close events - that would probably be the best place to disable/enable.

Let me know if this doesn't work. But I will look at fixing this on the ASScroll side too.

from asscroll.

jbarkun avatar jbarkun commented on August 18, 2024

Woah you're fast!

Just tried your suggestion on my build and it works great 👍 Thank you for the quick response, it's really appreciated. I'll let you know if I notice any issues with this approach as I keep working.

from asscroll.

ashthornton avatar ashthornton commented on August 18, 2024

Part of this issue is fixed in 1.7.6 by providing the class .asscroll-block, which can be added to the dropdown element in the Select2 options:

$('.select').select2({
    dropdownCssClass: 'asscroll-block'
})

This will prevent the page from scrolling when trying to scroll the dropdown element. The issue of the dropdown position not syncing with the page scroll is out of the scope of this project and would just require some manual position updates within Select2 based on the ASScroll position.

from asscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.