Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Console] Fix editor value resetting at layout change (#193516)
## Summary This PR fixes the bug where the editor input resets when we resize the page and the layout changes. The following fixes were applied: - The `isVerticalLayout` prop was moved one level down. This removes unnecessary rerendering of the editor when the layout is changed. - Allowed the localstorage value to be undefined. Undefined means that nothing is stored so we should display the default input. If an empty string is stored, we should display an empty editor. - Updates local storage with debounce every time when the editor input is changes. This ensures the editor input is not reset when the editor is rerendered. - Updates the local storage value to `undefined` if it is an empty string when data is being initialized at Main. This ensures that the default input is displayed when we switch between tabs/pages and the input is empty. Before: https://github.com/user-attachments/assets/a0535780-d75a-4df8-9e04-9d34b6f5f4f1 Now: https://github.com/user-attachments/assets/7db46c2c-c35e-461f-99e8-b86c66fb6ae5 --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information