Topic: Autocomplete doesn't always work when returning to a cached page.

softcon premium asked 2 years ago


Expected behavior Standard autocomplete behaviour - using Ajax

Actual behavior Doesn't always seem to work. Sometimes when I return to the page, when I click the field and start to type, no results are found - nothing at all. There is no JS error, and no search function takes place.

Resources (screenshots, code snippets etc.) I can't replicate it on a simple example. I suspect it is something to do with caching properties on the server.


Michał Duszak staff answered 2 years ago


Hello, problem may be the Ajax call you make. If there was a call, which received no data, but was successful, then no error will be thrown by default. See the snippet with the broken link: https://mdbootstrap.com/snippets/standard/m-duszak/3810242#js-tab-view

In this case I am getting an empty list, but the HTTP Status is 200 - so no errors will be thrown. See the outcome of a broken link - https://swapi.py4e.com/api/people/?search=broken

Please make sure your API works right.


softcon premium commented 2 years ago

The response is correct, and the response is very quick - but once in a while (afger refreshing the page, or coming back to the page from another page) it just doesn't do anything - eg, no ajax response is made (I checked using console logs). It just acts as though it is a normal textfield.


Michał Duszak staff commented 2 years ago

I was unable to reproduce this issue. It would be perfect if you would be able to share the demo.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.11.0
  • Device: PC
  • Browser: chrome, Edge, Firefox
  • OS: windows 10
  • Provided sample code: No
  • Provided link: No