Rightpanel Menu disappear when click inside Selectonemenu

aragorn
Posts: 3761
Joined: 29 Jun 2013, 12:38

22 Oct 2018, 14:05

Interesting! I still couldn't replicate it. Could you please test the following line after adding debugger to my above js code?

Code: Select all

<script type="text/javascript">
//<![CDATA[
/** 
 * PrimeFaces Ultima Layout
 * @Override _bindEvents method
 */
PrimeFaces.widget.Ultima = PrimeFaces.widget.Ultima.extend({
    
    _bindEvents: function() {
        this._super();
        
        var $this = this;
        
        $(document.body).off('click').on('click', function(e) {
            if(($this.isHorizontal() || $this.isSlim()) && !$this.menuClick && $this.isDesktop()) {
                $this.menu.find('.active-menuitem').removeClass('active-menuitem');
                $this.menu.find('ul:visible').hide();
                $this.menuActive = false;
            }
            
            if(!$this.topbarMenuClick && !$this.topbarLinkClick) {
                $this.topbarItems.find('.active-top-menu').removeClass('active-top-menu');
            }
            
            if(!$this.menuClick && $this.isSlim()) {
                $this.deactivateItems($this.menu.children('.active-menuitem'), false);
            }
            debugger; /* Please add this line to test if check */
            console.log($this.isOverlayInputPanelClicked(e));
            if(!$this.rightPanelClick && !$this.rightPanelButtonClick && $this.rightPanel.hasClass('layout-rightpanel-active') && !$this.isDatePickerPanelClicked() && !$this.isOverlayInputPanelClicked(e)) {                
                $this.rightPanel.removeClass('layout-rightpanel-active');
                $this.rightPanelButton.removeClass('rightpanel-btn-active');
            }
            
            if(!$this.topbarMenuClick && !$this.topbarLinkClick) {
                $this.topbarItems.removeClass('topbar-items-visible');
            }
                        
            $this.menuClick = false;
            $this.menuButtonClick = false;
            $this.topbarLinkClick = false;
            $this.topbarMenuClick = false;
            $this.rightPanelClick = false;
            $this.rightPanelButtonClick = false;
        });
    },
    
    isDatePickerPanelClicked: function() {
        if($.datepicker) {
            var input = $($.datepicker._lastInput);
            if(input.closest('.layout-rightpanel').length && $('#ui-datepicker-div').is(':visible')) {
                return true;
            }
        }
        return false;
    },
    
    isOverlayInputPanelClicked: function(e) {
        var el = $(e.target),
        panel = el.closest('.ui-input-overlay');
        if(panel.length) {
            var inputId = panel.attr('id').replace(/_panel/g, '');
            input = $(PrimeFaces.escapeClientId(inputId));

            if(input.length && input.closest('.layout-rightpanel').length) {
                return true;
            }
        }
        return false;
    }
    
});
//]]>
   </script>
Also, which device are you using? I tested it with LG G5.

markusg80
Posts: 69
Joined: 21 Nov 2013, 17:11

26 Oct 2018, 22:59

My Device is an IPhone 7. So after long time of research i can figure out that this effect only happens when i hold my Phone horizontal (x is larger than y on the screen).

Maybe you can reproduce with this information, also on your phone. I also have tested with an android phone on chrome browser with same behievor.

Also to get your debug code to work i have first to find a solution to debug javascript on my iphone.
PrimeFaces 6.2.14,Mojarra 2.3.0,Payara 5.184

aragorn
Posts: 3761
Joined: 29 Jun 2013, 12:38

31 Oct 2018, 14:23

I've tested it repeatedly. Unfortunately, I still couldn't replicate it. Maybe, you can detect the problem and fix it yourself. Please add debugger or alert to the above code.

Code: Select all

debugger; /* Please add this line to test if check */
console.log($this.isOverlayInputPanelClicked(e));
            
Or

alert($this.isOverlayInputPanelClicked(e)); 

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests