Author Topic: Can't type in text in header filter on Android  (Read 4345 times)

youngvan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 42
    • View Profile
Can't type in text in header filter on Android
« on: August 29, 2019, 09:20:35 pm »
Hi!
Any updated on this issue https://github.com/paramquery/grid/issues/163 ?

P.S. This problem is not produced on iOS devices, only android

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Can't type in text in header filter on Android
« Reply #1 on: August 29, 2019, 09:53:04 pm »
I don't see the mentioned issue in Pro version.

youngvan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Can't type in text in header filter on Android
« Reply #2 on: August 30, 2019, 02:15:26 pm »
We use ParamQuery Pro v6.0.0, so probably it's depends on version.
Was it fixed after 6.0 version or before?

youngvan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Can't type in text in header filter on Android
« Reply #3 on: September 03, 2019, 09:27:58 pm »
ping

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Can't type in text in header filter on Android
« Reply #4 on: September 03, 2019, 10:18:44 pm »
This works fine in v6.0.0 too

http://jsfiddle.net/a1nepgvx/1/show

No such issue has been reported in Pro as per my knowledge.

jplevene

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Can't type in text in header filter on Android
« Reply #5 on: July 22, 2023, 07:24:04 pm »
I found the issue, it is due to a Chrome bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1466893#c_ts1689983830)

The issue is that pqGrid, when there is a refresh or refreshView, pqGrid recreates its contents, so instead of just refreshing the grid and not the header, it does both.  This means that the selected filter gets destroyed (so it rightfully loses focus) then recreated.  We need a refreshGrid that doesn't refresh the header rows, which would fix this.

However, I did create a fix

Code: [Select]
// Get the name of the focused filter
var focus = $(grid).find("input.pq-search-txt:focus),
      focused_name= focus.attr("name");
// Do any grid refresh
$(grid).pqGrid("refresh");
// Now find the newly created filter input and select it
if(focused_name) $(grid).find("input.pq-search-txt[name="+focused_name+"]").focus();