5
  • Clicking into search box doesn't move caret to point of click

  • BugsDesktopDone

Steps to reproduce:

  • Search for text.
  • Click search bar, in the middle of the text, on results page

Expected behavior:
Caret should appear where clicked, as per regular HTML input boxes.

System info:
Firefox 96
macOS 12.1
UK / EUROPE-WEST

Image/Video:

  • Vlad replied to this.

    gaki It does for me. Can you try without extensions or a different browser?

    • gaki replied to this.

      Hi Vlad,

      I tried it in Edge and it worked fine there, so Chromium based browsers are presumably fine. I tried in Firefox with all addons disabled and the issue still exists, which suggests the bug is Firefox only: 96.0.3. Please note this only happens on first click; subsequent clicks work as expected.

      • Vlad replied to this.

        gaki I have tred in Firefox and was not able to reproduce.

          Strange. I don't really know what to say, other than I had a look at the attached events and the only difference is there's a bound focus event on first load, which is not there on subsequent clicks into the input. Might be a red herring 🤷‍♂️

            2 months later

            Oh, I used the Firefox dev tools to disable that focus event and the first click behaved as expected. Is it because that JS is first removing the search value searchBar.value = "" so Firefox puts the caret at the beginning/end of an empty string, and then the value is immediately put back with searchBar.value = value but now the browser does not know where in the string it was originally clicked, because it's technically a different string?

            • z64 replied to this.

              gaki

              JS is first removing the search value searchBar.value = "" so Firefox puts the caret at the beginning/end of an empty string, and then the value is immediately put back with searchBar.value = value

              Not sure I'm fully understanding this thread - but as an FYI this code is removed in our next release, if it is causing problems for you.

                6 days later
                No one is typing