-
Notifications
You must be signed in to change notification settings - Fork 25
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
Is it possible to set the code-input element to read-only? #59
Comments
The I will try to fix the bug this weekend, or if you understand the codebase and want to do it via a pull request, please let me know. |
Here's the JavaScript code: let codeInput = document.querySelector("code-input"); // Or get your element in another way
codeInput.setAttribute("disabled", true); // Make read-only
codeInput.removeAttribute("disabled"); // Make editable again |
That's perfect, it'll work wonders, as the code-input editor is another template I don't think it'll interfere. Thank you very much! This element is a life-saver! |
I will try to implement the bug fix this weekend - please could I check that you are using the latest version 2.0? |
I have released this functionality in v2.0.3. Please let me know if it doesn't work. |
For your information, please see the updated code snippets above (it turns out I was slightly wrong at first). If you want, you could use the |
I was wondering if it is possible to set this element to a read-only state, so that in one page you write the code then it is shown in another page without the user being able to edit it.
The text was updated successfully, but these errors were encountered: