Giter Site home page Giter Site logo

Comments (4)

vodkabears avatar vodkabears commented on July 16, 2024

@martinpesout the way like this i think:

$(document).on('open', '.remodal', function () {
    $('input').attr('tabindex', "-1");
    $('.modal-form input').each(function(index, input) {
        input.tabIndex = index + 1;
    });
});

$(document).on('close', '.remodal', function () {
    $('input').each(function(index, input) {
        input.tabIndex = index + 1;
     });
});

I don't know maybe the code above is too complicated, but i think it should work. Anyway look at remodal's events like close, open and etc. You can check them here: https://github.com/VodkaBears/Remodal#events

from remodal.

martinpesout avatar martinpesout commented on July 16, 2024

Yeah, you are right. I think that it could be solution. But it's necessary to include other form field elements. And also it's important to call next definition during open event.

$('.modal-form').find('input select textarea').first().focus();

from remodal.

vodkabears avatar vodkabears commented on July 16, 2024

yep.

from remodal.

PradeepNair1988 avatar PradeepNair1988 commented on July 16, 2024

Hi ,

I encountered the same issue and below logic helped me to resolve the issue.

// On the open of Modal window
//Updating the tabindex value to another attribute and make the tabindex =-1 which is the background
var inputs = $(document).find('select, input, textarea, button, a').filter(':visible');
$(inputs).each(function(){
var tbindex=$(this).attr("tabindex");
$(this).attr("data-index",tbindex);
$(this).attr("tabindex",-1);
});
// On the close of Modal window
//Re-update the tabindex value to from the attribute which you have set when you are opening the modal window.
var inputs = $(document).find('select, input, textarea, button, a').filter(':visible');
$(inputs).each(function(){
var tbindex=$(this).data("index");
if(tbindex){
$(this).attr("tabindex",tbindex);
}
});

from remodal.

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.