kiwix-desktop
kiwix-desktop copied to clipboard
Set focus on search bar shortcuts such as f6, ctrl + l, alt + d don't properly work
When I press the focus on search bar shortcut such as f6, ctrl + l, alt + d it focuses on the search bar as expected. Afterward I type some text on the search bar and press enter, nothing happens. What I expect is that it goes to the site I searched for. It does however work properly when I click on the search bar with the mouse. So mouse clicking on the search bar and pressing one of the shortcuts don't have the same behavior, even though they should. Additionally, after pressing one of the shortcuts, the mouse clicking doesn't work as well anymore. So pressing one of the shortcuts changes a state to where the search bar doesn't work. If then I mouse click somewhere on the page to remove focus on the search bar followed by a mouse click on the search bar, the state changes to where the search bar works again.. Also, the search bar doesn't work immediately after focus by mouse click. Afterward typing some text it does work again. That issue might be related to this one with the shortcuts.
Seems like the pull request https://github.com/kiwix/kiwix-desktop/pull/436 didn't implement the shortcuts to focus on the search bar correctly, but I'm not sure. I guess there is something weird with the implementation of the SearchBar
class.
Currently, I'm running kiwix-desktop 2.3.1 on windows 7. I hope this issue could be reproduced on other operating systems.
I also tested on windows 10. Exactly the same behavior.
This is definitely buggy behavior. The behavior is very messy. That's why I had to elaborate on this issue. To get a better understanding, compare the behavior of the search bar from kiwix-desktop to the address bar from any other browser such as firefox or chrome.
I tested the appimage of kiwix-desktop 2.3.1 on my Pop!_OS 20.04 LTS. The behavior there is exactly the same as on Windows.
This PR should resolve the weird behavior. The #436 was not using shortcut focus events correctly and we got a different behavior. It was also a duplication of the existing shortcut constructs.
@ShaopengLin Thank you for your PR but my problem is that I don't even understand the bug report! Do you think you would be able to phrase it differently so I can check if your PR solves the problem?
@kelson42 The bug is that using shortcuts to search doesn't work:
- Use either of the 3 shortcuts to navigate to the search bar
- search anything
- type enter or click on the suggestion
You should see the search did not take place. This is due to the search action not being properly activated by using shortcuts.