You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Could not use Chinese input method for searching on showcase #8701
I have read the console error message carefully (if applicable).
Description
Using a Chinese input method in the search field of the showcase will result in incorrect text output and prevent the search function from operating properly.
I think this is because the page continuously refreshes due to changing URL query, and each time the search box is programmatically re-focused. We can see what we can do, but I'm not sure whether we can let input events not fire when the text is captured by the input method. FWIW, you should not be using Chinese anyway, since the showcase is not localized.
I think this is because the page continuously refreshes due to changing URL query, and each time the search box is programmatically re-focused. We can see what we can do, but I'm not sure whether we can let input events not fire when the text is captured by the input method. FWIW, you should not be using Chinese anyway, since the showcase is not localized.
Is this submission workflow still relevant?
I feel that contributions weren't accepted since months.
I've categorized the search component into two types: mobile and desktop. The search logic for the mobile remains the same; however, for the desktop with a screen width threshold of above 768px, the debounce function is introduced to address the Chinese input issue. This creates two issues for the desktop: Firstly, Chinese input needs to be completed within 800 milliseconds. Secondly, there is a delay of 800 milliseconds when refreshing the search on the desktop, as it changes from being instantaneous to a delayed response.
Activity
Josh-Cena commentedon Feb 23, 2023
I think this is because the page continuously refreshes due to changing URL query, and each time the search box is programmatically re-focused. We can see what we can do, but I'm not sure whether we can let input events not fire when the text is captured by the input method. FWIW, you should not be using Chinese anyway, since the showcase is not localized.
Shake-Jarjane commentedon Mar 7, 2023
Is this submission workflow still relevant?
I feel that contributions weren't accepted since months.
rockbenben commentedon Mar 18, 2023
I've categorized the search component into two types: mobile and desktop. The search logic for the mobile remains the same; however, for the desktop with a screen width threshold of above 768px, the
debouncefunction is introduced to address the Chinese input issue. This creates two issues for the desktop: Firstly, Chinese input needs to be completed within 800 milliseconds. Secondly, there is a delay of 800 milliseconds when refreshing the search on the desktop, as it changes from being instantaneous to a delayed response.demo: https://github.com/rockbenben/ChatGPT-Shortcut/blob/fc99b18069530be82ba0e62b87524891d6a0b56c/src/pages/index.tsx#L217