Skip to content

First modification in JSON is not propagated #79

Closed
@i4i4n

Description

@i4i4n

Before you start, please make sure to:

  • Read the doc
  • Have tried the latest version
  • Search to see if your issue already exists
  • Look for / ask questions on Stack Overflow

Link to minimal reproduction

https://play.vuejs.org/#eNqNU01v4jAQ/StWLgWJxIu4rBAgdlcclkO72lY95ZImA3XXX7KdFCnKf9+xTdMQtRUHJDzz5r039kub/NA6a2pIlsnKloZpRyy4Wm9yyYRWxpGWGDiQjhyMEuQGoTd9a2+V3FXMKfNYwxnwgrUUQjGN4FyWSlpHqsIVZO3ZJtNcosoDE6BqN5lMyXpDJr6fNQVHqjWZT2f4y+WKRlfoBw8OhOaFAzwRshpJkSYVqgK+zhNPlSebFR1BwtxjkGCS7O/vbpekbaOzrvNqvUIyS+KWqSh05nnwilo/n58bNk9w2ld8Ddn9OU+endN2SWlZSRxDP6wxmQRHpRZ0izBqaulw9bRSYrvIFtl3WjHrhuUMrEifjHq1YDJtVIVMeTIbaFHsNGBSA7ICA+Za7dHYUH/UuvAwlk8rEOwKzTco5eyJNgvKkPuUiUu6QjLOi9TfcXyqa4g/GOoZR69+Bd1oYvstm8/jrYw60bsXwrh0GBJnMd0HdhxFpFRCMw7mTjuG6b+ISsG5et2HmjM19LbLZyj/fVB/sae4wh8D4ZEGq7rCHMHF9u7+Fk74v2/i51Dz8/qfNP+CVbz2HiPsZy0rtD3ABbe/Q+KZPD7Y3cmBtG9LeaPhNgI+ZOPXF6u/28Xg9bfY/QfrfIqQ

Steps to reproduce

Step 1.: edit the value "1" to "2" in the JSON editor and hit Enter (or click outside to validate the edit).
Step 2.: edit the value "2" to "3" in the JSON editor and hit Enter (or click outside to validate the edit).

What is expected?

After step 1., "Value in JSON:" should be "2".
After step 2., "Value in JSON:" should be "3".

What is actually happening?

After step 1., "Value in JSON:" is still "1". <= this is incorrect
After step 2., "Value in JSON:" is "3". <= this is OK

So in short, the first edit is not propagated to the reactive variable containing the JSON data. After the second edit, the propagation is restored.

System Info

Tested on latest versions of Firefox and Chrome, on macOS Ventura 13.6.1.

Package Manager

None

Any additional comments?

If I set the value of the JSON editor synchronously this behavior doesn't happen.
This only happens when the value is set asynchronously (simulated in the repro with the setTimeout).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions