Dropdown auto close on tablet Android
** I'm submitting to ... ** (check one with "x") (I.e. [X] bug report => Search github for a similar issue or PR before submitting [] feature request => Please check if request is not already on the roadmap https://github.com/primefaces/primeng/wiki/Roadmap [] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35 (I.e.
** Plunkr Case (Bug Reports) ** Please show your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewedd in detail and assisted.
http://next.plnkr.co/edit/DqMzyAm1zoeSXmzk
** Current behavior **
When open p-dropdown with filter on tablet, it's automatically closing. we can see the link below
https://youtu.be/8Scu7yctTA0
** Expected behavior **
Not auto close p-dropdown when open on tablet.
** Minimal reproduction of the problem with instructions **
Implements any p-dropdown with a filter and execute on tablet.
https://youtu.be/8Scu7yctTA0
http://next.plnkr.co/edit/DqMzyAm1zoeSXmzk
-
** Angular version: ** 7.X
-
** PrimeNG version: ** 7.X
-
** Browser: ** [Chrome XX | Firefox XX]
-
** Language: ** [all | TypeScript 3.X | ES6 / 7 | ES5]
+1
+1
Duplicate of https://github.com/primefaces/primeng/issues/7125
I do have this issue.. primeng dropdown filter not working in android devices. I found some temporary quick fix.
node_modules/primeng/components/dropdown/dropdown.js
I have changed directly in node_modules as i need quick fix
Dropdown.prototype.onMouseclick = function (event) {
.........
.........
// setTimeout(function () {
// if (_this.filterViewChild != undefined) {
// _this.filterViewChild.nativeElement.focus();
// }
// }, 200);
}
I have hidden this and it worked 👍
after that search not working then i have made this change
Dropdown.prototype.onOverlayAnimationStart = function (event) {
..............
..............
// this.bindDocumentResizeListener();
}
The issue is caused by hiding dropdown on window.resize event when there's some input (ex. for filtering) that is getting focus on control show. On mobile (Android) devices the soft keyboard is popping out and that rises window.resize event. Solution would be to check if we are on mobile device and react on 'orientationchange' event instead of 'resize' as it's not possible to resize window on mobiles/tablets (at least on most of them).
I've created an Angular directive with temporary workaround (works on devices I have available to test) and example usage - the code is here on Stackblitz, and here's direct link to the example app Be aware that it blocks the 'resize' event on mobile devices (but allows on 'resize' event on 'orientationchange'). If you have better ideas/workarounds - please share.
7030
The same issue still exists on mobile Android devices when selecting the input box on a table filter:
https://www.primefaces.org/primeng/showcase/#/table/filter
I believe this requires the same fix.
O mesmo problema ainda existe em dispositivos móveis Android ao selecionar a caixa de entrada em um filtro de tabela:
https://www.primefaces.org/primeng/showcase/#/table/filter
Eu acredito que isso requer a mesma correção.
i have the same problem, and with primeng 13.3.3, does anyone have a solution?