Implement a way to trigger executing onEditable again
#1.261 geöffnet am 5. März 2021
Repository-Metriken
- Stars
- (10.781 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 15h 36m) (3 gemergte PRs in 30 T)
Beschreibung
We have a case where we dynamically switch the editor from read-only to editable. However, in code or text mode this isn't applied properly because the onEditable callback is only called on creation.
This is not clear from the docs:
In modes text and code, the callback is invoked as editable(node) where node is an empty object (no field, value, or path). In that case the function can return false to make the text or code editor completely read-only.
If it's not possible to handle this dynamically, having to call .refresh() to update the mode also comes a long way. Currently we recreate the editor when we want to switch from read-only to editable.