First letter of search draft is removed when closing chat - 215.6.14-secure - 1.21.5
Description
With search drafting enabled, closing out of chat will remove the first character from the search box. Opening and closing chat repeatedly will eventually remove the entire draft.
How to reproduce
- Enable Search drafting toggle in settings (on by default)
- Open chat
- Enter some characters into the search box
- Close out of chat (by pressing escape or sending a message)
- Open chat again, and the search string will now be missing the first character. For example,
Search->earch.
Expected result
Drafting should keep the whole search string instead of removing the first letter.
Log file link
Probably not applicable, but: https://mclo.gs/ZLOXprf
Specs and Details
Required information:
- OS: Windows 11 Pro 10.0.22631 Build 22631
- Mod version: 215.6.14-secure
- Fabric version: 0.16.14
- Fabric API version: 0.121.0+1.21.5
- YetAnotherConfigLib version: 3.6.6+1.21.5-fabric
- Mod Menu version: 14.0.0-rc.2
while your PR is more straightforward than the existing code, i haven't been able to reproduce this as is. are you sure there isn't some other issue going on?
Very strange. If it makes a difference, I'm using Prism Launcher (9.4) with Java 21.0.3. Had the same issue on both my Windows computer and on a different Linux system both using Prism. Feel free to discard this PR/issue if you aren't able to reproduce.
Edit: I just remembered that this was also occurring when building and running directly, so maybe has to do with Java version?
i'll still approve the PR and close the issue, considering the changes don't make anything else break and they're more readable. i just can't confirm whether it's fixed or not which might lead to further confusion in the future