mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-21 20:09:37 +00:00
fix(@desktop/statusq): Fix StatusBaseInput marked dirty in case of
rich text if visual input is empty Fixes #8599
This commit is contained in:
parent
bfdd9092e1
commit
b901f32dd8
@ -368,10 +368,15 @@ Item {
|
||||
onCursorRectangleChanged: Utils.ensureVisible(flick, cursorRectangle)
|
||||
onActiveFocusChanged: if (root.pristine) root.pristine = false
|
||||
onTextChanged: {
|
||||
if (previousText === text) {
|
||||
if (previousText === text || (previousText == "" && length == 0 && length != text.length)) {
|
||||
// Not sure why, but the textChanged event was triggered even if it didn't really
|
||||
|
||||
// Avoid further processing on initial condition when previousText is empty
|
||||
// but text is set to default rich text, as it will mark input dirty and
|
||||
// trigger validation, with likely not valid state
|
||||
return
|
||||
}
|
||||
|
||||
root.dirty = true
|
||||
if (root.maximumLength > 0) {
|
||||
let utf8Length = Utils.encodeUtf8(text).length
|
||||
|
Loading…
x
Reference in New Issue
Block a user