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

Clicking the Picker textbox wont open the Time picker #81

Open
pankajmehra009 opened this issue Mar 11, 2019 · 1 comment
Open

Clicking the Picker textbox wont open the Time picker #81

pankajmehra009 opened this issue Mar 11, 2019 · 1 comment

Comments

@pankajmehra009
Copy link

In case there are 2 or more Pickers on a page and one of them is open, On clicking any other picker textbox wont open the picker for that textbox.

Expected is when we click a textbox then picker for that textbox should popup and the already open should close.

I added below code for it but IE11 page freezes:

      $('.bc-c-selectTime__input.js-clock').on('click', function() {
            if($(".wickedpicker:visible").length > 0 &&
               ($(".wickedpicker").offset().left !=  $(this).offset().left
                || $(".wickedpicker").offset().top !=  $(this).offset().top + $(this).height()
                )
               ){
                    $('.bc-c-selectTime__input.js-clock').wickedpicker("hide")
                    $(this).trigger('click');
            }
        });
@pankajmehra009
Copy link
Author

to fix the above issue, I added a function in wicked.min.js

_showWPicker:function(e){this.showPicker(e);window.lastTimePickerControl=$(this);}

After _hide method.

and calling from the HTML as

        $('.bc-c-selectTime__input.js-clock').on('click', function(event) {                    
            if($(".wickedpicker:visible").length > 0 &&
               ($(".wickedpicker").offset().left !=  $(this).offset().left
                || $(".wickedpicker").offset().top !=  $(this).offset().top + $(this).height()
                )
               ){
                $(this).wickedpicker('showWPicker', 0 ,$(this));
            }
        });

Hope this helps!

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

1 participant