question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

read-only or non-editable elements

See original GitHub issue

Is it possible to set certain (but not all) text or math elements on a page to be read only? This would mean that they would be visible but not editable. For example, the MathQuill editor would not be launched when a read-only math element was focused. Can this be set in the state - something like the following maybe?

{type: "math", src: "y=a\sin\left(bx\right)", inline: false, readOnly: true, children: [{text: ""}]}

Or is there another way to do this?

Thanks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
inyonocommented, Jul 15, 2020

Thanks for the info. I need to get my head around the codebase a bit more, I think, before attempting this. Should I be looking in the katex plugin to implement this? https://github.com/edtr-io/edtr-io/blob/master/packages/plugins/text/src/plugins/katex/index.tsx

Yep, basically:

  • Fork packages/plugins/text.
  • Extend packages/plugins/text/src/plugins/katex with your functionality.
0reactions
markhatscommented, Jul 14, 2020

Thanks for the info. I need to get my head around the codebase a bit more, I think, before attempting this. Should I be looking in the katex plugin to implement this? https://github.com/edtr-io/edtr-io/blob/master/packages/plugins/text/src/plugins/katex/index.tsx

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML attribute: readonly - HTML: HyperText Markup Language
The Boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control.
Read more >
readonly attribute of input and textarea elements
readonly attribute of input and textarea elements. - LS. Makes the form control non-editable. Unlike the disabled attribute, readonly form controls are ...
Read more >
HTML readonly Attribute
The readonly attribute on an input element specifies that the element is read-only which means the element is non-editable. Readonly input elements are ......
Read more >
HTML5 Forms: Readonly Type Attribute
The readonly attribute makes a form control non-editable (or “read only”). ... You can target elements that are read only with the :read-only...
Read more >
Read-Only Input Elements vs. Non-Input Element [duplicate]
There's nothing wrong with using disabled inputs on a text or textarea type of input. It's part of the HTML5 specification, and most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found