Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cursor navigation and backspace functionality CodeTool #76

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

idebenone
Copy link
Member

@idebenone idebenone commented Oct 30, 2024

Problem:

Users were unable to delete text with backspace and navigate with prefilled data.

Solution:

Update textarea.textContent to textarea.value while getting and setting code data.

closes #67

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@neSpecc
Copy link
Contributor

neSpecc commented Nov 8, 2024

Have you discovered why this problem appears only when tool rendered with saved data? If you add the new block, it can't be reproduced

@idebenone
Copy link
Member Author

idebenone commented Nov 8, 2024

Have you discovered why this problem appears only when tool rendered with saved data? If you add the new block, it can't be reproduced

image

The first code block is rendered with saved data and you can see it between the textarea tags -> print("Namaste World"),

The second code block was added manually and it does have data but it's not rendered in the html -> we are passing it in the value attribute of textarea.

I suspect this might be the reason why are are not able to navigate with cursor and also can't delete the data. If we manually remove that from html (dev tools), it works, which proves we are suspecting the right reason.

@idebenone idebenone changed the title Fix cursor navigation and backspace functionality CodeTool Fix cursor navigation and backspace functionality CodeTool - Firefox Nov 10, 2024
@idebenone idebenone changed the title Fix cursor navigation and backspace functionality CodeTool - Firefox Fix cursor navigation and backspace functionality CodeTool Nov 11, 2024
dev/index.html Outdated Show resolved Hide resolved
@idebenone idebenone merged commit af1cc25 into master Nov 19, 2024
1 check passed
@neSpecc neSpecc deleted the fix/backspace-and-navigate branch November 19, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot delete text with backspace or navigate with arrow keys in Firefox
2 participants