input: Fix to let set_value works when Input is disabled. (#1103)

This commit is contained in:
Jason Lee 2025-07-29 17:55:53 +08:00 committed by GitHub
parent 7487662343
commit 518004a014
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -664,7 +664,9 @@ impl InputState {
cx: &mut Context<Self>,
) {
self.history.ignore = true;
let was_disabled = self.disabled;
self.replace_text(value, window, cx);
self.disabled = was_disabled;
self.history.ignore = false;
// Ensure cursor to start when set text
if self.mode.is_single_line() {