Keydown and Keyup not working as expected in Vertical mode

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Keydown and Keyup not working as expected in Vertical mode

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21320
    tavy87
    tavy87
    Participant

    I’m wondering why in vertical mode the keyboard Down and Up presses do not scroll the page. I noticed in one of the JS files that there is some code that checks if the mode is vertical, and if so, checks for certain keypresses:

    if (keycode == 40) {
                            e.stopPropagation();
                            e.preventDefault();
                            $this.n.text.blur();
    
                            if ($this.post != null) $this.post.abort();
                            if ($('.item.hovered', $this.n.resultsDiv).length == 0) {
                                $('.item', $this.n.resultsDiv).first().addClass('hovered');
                            } else {
                                $('.item.hovered', $this.n.resultsDiv).removeClass('hovered').next().next('.item').addClass('hovered');
                            }
                            if ($this.is_scroll) {
                                $this.scroll.mCustScr("scrollTo", ".resdrg .item.hovered",{
                                    scrollInertia: 200,
                                    callbacks: false
                                });
                            }
                        }
                        if (keycode == 38) {
                            e.stopPropagation();
                            e.preventDefault();
                            $this.n.text.blur();
    
                            if ($this.post != null) $this.post.abort();
                            if ($('.item.hovered', $this.n.resultsDiv).length == 0) {
                                $('.item', $this.n.resultsDiv).last().addClass('hovered');
                            } else {
                                $('.item.hovered', $this.n.resultsDiv).removeClass('hovered').prev().prev('.item').addClass('hovered');
    
                                if ($this.is_scroll) {
                                    $this.scroll.mCustScr("scrollTo", ".resdrg .item.hovered", {
                                        scrollInertia: 200,
                                        callbacks: false
                                    });
                                }
                            }
                        }

    I removed this code manually, and it seems to fix my issue, but I’m wondering if there is a simpler fix that will protect me from plugin updates overwriting it?

    #21322
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It is an intended feature, to scroll the results window automatically, when the scrollbar is visible. However it does not seem to work correctly, when the viewport is high, and the scrolling occurs on the window itself.

    This is definitely a bug I am going to address in the upcoming release, so you don’t have to worry about it anymore.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21328
    tavy87
    tavy87
    Participant

    Thank you! I wasn’t sure if it was because I customized the vertical template or not, but that makes sense that it only seems to be an issue at high viewport sizes. Do you know when you expect the fix to occur approximately? I don’t mind waiting, I just want to be aware of when I should test it again.

    Thank you

    #21331
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Well, I am hoping within 10 working days. It is going to be a major update, the testing will take a couple of days unfortunately.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.