Search text shifts when clicking into the search field, causing incorrect caret placement
After performing a search in Proton Mail, the search field displays a magnifying-glass icon before the search query.
If I then want to slightly modify the query — for example, change one character in robert — I click at a specific position inside the text to place the caret there or start selecting a character with the mouse.
However, as soon as the search field receives focus, the magnifying-glass icon disappears and the entire query shifts to the left.
As a result, the text moves underneath the mouse pointer during the click, so the caret is placed in a different position than the one I clicked.
For example:
1. Search for robert and press Enter.
2. The results appear and the search field shows a magnifying-glass icon before robert.
3. Click just before the letter o, intending to place the caret there or select that character.
4. The icon disappears and robert shifts to the left.
5. The caret ends up somewhere else in the word instead of at the clicked position.
This makes even very small edits to an existing search query unnecessarily frustrating, especially when trying to select a single character by clicking and dragging.
Expected behavior:
Focusing the search field should not change the horizontal position of the existing query. Clicking at a specific character position should always place the caret exactly where the user clicked.
Possible solutions would be to keep the magnifying-glass icon visible while editing, reserve the same amount of space for it after focus, or otherwise prevent the text from shifting when the field changes state. Alternatively, if the icon is intended to indicate that the field represents an active search whose results are displayed below, it could be shown on the right side of the search field instead, so that its appearance or disappearance does not affect the position of the query text.
This violates the basic expectation that text should remain stationary while the user is positioning the caret with the mouse.