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
[ZEPPELIN-6298] Fix cursor-related issues in New UI's Paragraph
### What is this PR for?
**Description:**
Cursor behavior in the New UI’s paragraph needs to be fixed for several cursor related actions, including double-clicking, running all above/below, adding(clone), and removing paragraphs.
When **cloneParagraph()** is called, it internally calls **addParagraph()**, which has already been tested. The same addParagraph-related code is also applied in #5044. If either PR is merged first, I will rebase accordingly. I have also confirmed that **cloneParagraph()** works correctly through #5044.
Due to timing issues, I used `setTimeout` for **removeParagraph()** and **doubleClickParagraph()**. Since this is in the UI area, it likely won’t have major side effects, but I will look into it further.
**Expected:**
- When **doubleClickParagraph()** is executed, the cursor should move to the end of the paragraph.
- When **runAllAbove()** or **runAllBelow()** is executed, the current cursor position should be remembered, and after execution, focus should return to the previous cursor position.
- When **addParagraph()** is executed, the newly added paragraph should receive focus.
- When **removeParagraph()** is executed, focus should move to the paragraph that takes the deleted paragraph’s place.
**Actual (New UI):**
- When **doubleClickParagraph()** is executed, the cursor moves to the beginning instead of the end.
- After **runAllAbove()** or **runAllBelow()**, focus is lost completely.
- When **addParagraph()** is executed, the new paragraph does not automatically receive focus.
- After **removeParagraph()**, focus may not move to the correct paragraph.
**[Appropriate action - Classic UI]**
https://github.com/user-attachments/assets/fc0066f7-4e03-4e3b-9d5b-2f33df415ba7
Run all above -> Run all below -> Double click .md paragraph -> Add paragraph -> Delete paragraph
**[AS-IS]**
https://github.com/user-attachments/assets/f699f788-cf29-4c4c-8c47-2ef34d7962f0
Run all above -> Run all below -> Double click .md paragraph -> Add paragraph -> Delete paragraph
**[TO-BE]**
https://github.com/user-attachments/assets/1206c524-103f-4328-85ee-04408073b628
Run all above -> Run all below -> Double click .md paragraph -> Add paragraph -> Delete paragraph
### What type of PR is it?
Bug Fix
### Todos
### What is the Jira issue?
* [[ZEPPELIN-6298](https://issues.apache.org/jira/browse/ZEPPELIN-6298)]
### How should this be tested?
### Screenshots (if appropriate)
### Questions:
* Does the license files need to update? N
* Is there breaking changes for older versions? N
* Does this needs documentation? N
Closes#5057 from dididy/fix/ZEPPELIN-6298.
Signed-off-by: ChanHo Lee <[email protected]>
(cherry picked from commit 4fbfaec)
Signed-off-by: ChanHo Lee <[email protected]>
0 commit comments