allowFiltering="true" reloads the page on mobile/tabled devices

Its very easy to reproduce error, it all works good on desktop, however if allow filtering on dropdownlist is allowed and you use a mobile/tabled device the dropdownlist becomes fullscreen on focus/click. When you select a field from a dropdownlist the page reloads. You can test this by using Chrome's Ipad device view from debugging window. The same thing happens in production, after I do the build and test it from my mobile devices. Please fix this, its been happening for a while.

Additionally: 
1) multiselect with checkbox mode also goes fullscreen on mobile devices, which is a bug, but it does not refresh on selection which is good.
2) multiselect on mobile devices does not fire change event when exiting the popup, it fires change event after exiting the popup and clicking anywhere else on the side to clear the focus from it.




6 Replies 1 reply marked as answer

BC Berly Christopher Syncfusion Team June 9, 2021 12:07 PM UTC

Hi Dimitrije, 
  
Greetings from Syncfusion support. 
  
Query 1: 
  
Its very easy to reproduce error, it all works good on desktop, however if allow filtering on dropdownlist is allowed and you use a mobile/tabled device the dropdownlist becomes fullscreen on focus/click. When you select a field from a dropdownlist the page reloads.  
  
Response: 
  
We have checked the reported issue and we would like to inform you that in mobile mode, the DropDownList will be opened in another page and the input element will be opened in another page. While pressing the back button, we need to go back to the previous page and save the history.     
  
So, in our source, we used history.back method. If we remove the history.back method from our source, it does not actually navigate to the previous page (Input element page) and simply closes the page. Thus, we override the source to prevent a pop-state event from triggering while selecting the value. Please use the following solution at the sample level to prevent an event from triggering globally for all dropdowns.   
  
    ngOnInit() {  
        const popHandler = (e=> {  
           console.dir(e);  
           console.log('browser history chanegd.')  
       };  
       window.addEventListener('popstate'popHandler, { once: true });  
       (DropDownList as any).prototype.onMouseClick = function (e) {  
       let targetElement = <Element>e.target;  
           let classListDOMTokenList = target.classList;  
           let liHTMLElement = <HTMLElement>closest(target'.' + 'e-list-item');  
           if (!this.isValidLI(li)) {  
               return;  
           }  
           this.setSelection(lie);  
           if (Browser.isDevice && this.isFilterLayout()) {  
                var delay = 100;  
                this.closePopup(delay);  
           } else {  
               let delaynumber = 100;  
               this.closePopup(delay);  
           }  
       };  
     }  
   
  
Please find the sample from the below link.  
  
Still issue persists, please revert us with issue reproducing sample along with replication scenario that will help us to check and proceed further at our end.   
  
Query 2: 
  
multiselect with checkbox mode also goes fullscreen on mobile devices, which is a bug, but it does not refresh on selection which is good. 
 
Response: 
  
We would like to inform you that, when opening the popup in the mobile mode, it displays in the full screen which is implemented for the better UI experience for the user. So, this is a default rendering mode in the mobile devices. 
  
We can disable this behavior by overriding the popup element style as mentioned below code snippet. 
  
 onOpen(event) { 
    setTimeout(() => { 
      if (Browser.isDevice) { 
        var parentElement = (this.mulObj as any).overAllWrapper; 
        event.popup.position = { X: 'left'Y: 'bottom' }; 
        event.popup.width = parentElement.offsetWidth; 
        event.popup.dataBind(); 
        event.popup.element.classList.remove( 
          'e-ddl-device', 
          'e-popup-full-page' 
        ); 
        event.popup.element.style.top = 
          parseInt(event.popup.element.style.top) + 
          parentElement.offsetHeight + 
          'px'; 
        event.popup.element.style.bottom = 'auto'; 
        event.popup.element.style.maxHeight = (this.mulObj as any).popupHeight; 
        event.popup.element.querySelector('.e-content').style.maxHeight = 
          parseInt((this.mulObj as any).popupHeight) - 35 + 'px'; 
        event.popup.element.querySelector('.e-content').style.height = 
          'initial'; 
      } 
    }); 
  } 
 
  
  
Query 3: 
  
multiselect on mobile devices does not fire change event when exiting the popup, it fires change event after exiting the popup and clicking anywhere else on the side to clear the focus from it. 
  
Response: 
  
By default, change event will be triggered after focus out the component. This is the default behavior of component. We can change this behavior by disable the changeOnBur property as mentioned below. 
  
  
    <ejs-multiselect id='multiselect-checkbox' width="300px" [changeOnBlur]="changeOnBlur" 
                (open)="onOpen($event)" (change)="onChange($event)" #checkbox [dataSource]='countries' 
                [placeholder]='checkWaterMark' [fields]='checkFields' [mode]='mode' popupHeight='300px' 
                popupWidth='300px' [showDropDownIcon]='true' showSelectAll='true' 
                [filterBarPlaceholder]='filterPlaceholder'> 
            </ejs-multiselect> 
  public changeOnBlur = false; 
 
  
Regards, 
Berly B.C 


Marked as answer

LA Lana June 7, 2023 08:21 AM UTC

Hi, how can I prevent popup event for syncfusion dropdowns in Vue? Can't figure out how to rewrite the example for Angular.



UD UdhayaKumar Duraisamy Syncfusion Team June 8, 2023 02:09 PM UTC

The open and close events will be triggered when the DropDownList popup opens and closes. You can prevent these events by setting the popup event arguments' cancel property to true. Please refer to the shared documentation below for more information.


Documentation:





LA Lana June 14, 2023 10:19 AM UTC

I meant prevent a pop-state event triggered by popup. I don't need to prevent popup to open or close, but prevent it to trigger pop-state event. It's prevented in this reply but for Angular: https://www.syncfusion.com/forums/166214/allowfiltering-true-reloads-the-page-on-mobile-tabled-devices?reply=SEnp3t  How can I do that in Vue?



KP Kokila Poovendran Syncfusion Team July 6, 2023 06:43 AM UTC

Hi Dimitrije, ,

Thank you for reaching out to us with your query. We understand that you would like to prevent the triggering of the pop-state event in Vue, similar to the solution provided for Angular.



We have prepared a sample specifically for Vue that addresses your requirement. You can find the Vue sample in the attachment.


Regards,
Kokila Poovendran.


Attachment: dropdown_ab39e5b8.zip


LA Lana July 6, 2023 12:09 PM UTC

Yes, that works. Thank you!


Loader.
Up arrow icon