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.

Removing the tooltip on the read-only editor that says 'cannot edit in read-only editor'

See original GitHub issue

Hi, I tried to remove the tooltip that says 'cannot edit in a read-only editor using CSS. But, it seems that the CSS although applied is not working.

Given below is the screenshot of the issue that I am facing:

image

Below given is the editor options that I am setting

value: this.configOriginal, language: 'json', theme: this.theme, scrollBeyondLastLine: false, contextmenu: false, readOnly: true, cursorWidth: 0,

And given below is the CSS that I am trying to use to hide the tooltip: .monaco-alert { display: none !important; visibility: hidden !important; }

Can anyone please help me solve this? I have been struggling with this since a long time.

Thank you so much.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

15reactions
brijeshb42commented, Jan 8, 2020

@kubocob Here is something that I tried and should work for your use case.

const editor = /* your editor instance */;
const messageContribution = editor.getContribution('editor.contrib.messageController');
const diposable = editor.onDidAttemptReadOnlyEdit(() => {
  messageContribution.showMessage('Your reason to not allow editing.', editor.getPosition());
});

This code will immediately override the default Cannot edit read-only editor with your custom message.

4reactions
kubocobcommented, Jan 2, 2020

It would be nice, if the message tooltip could be customisable. This could be used for explanation of the “custom” reason, why the editor is in read-only state:

  • “You need to save the file locally before editing”
  • “Text is locked for editing”
  • “You are previewing the previous version of the file”
Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing read-only editor tooltip (monaco-alert) from the ...
I tried to remove the tooltip that says 'cannot edit in a read-only editor using CSS. But, it seems that the CSS, although...
Read more >
Removing the tooltip on the read-only editor that says 'cannot edit in ...
Hi, I tried to remove the tooltip that says 'cannot edit in a read-only editor using CSS. But, it seems that the CSS...
Read more >
Configuration - Editor.js
If there is an error during initialization the isReady promise will be rejected with an error message. var editor = new EditorJS(); editor....
Read more >
How to Set the Read-only TextBox in React TextBox component
You can make the TextBox as read-only by setting the readonly attribute to the input element. Source. Preview.
Read more >
EditorViewModel | ArcGIS Maps SDK for JavaScript 4.25
Attachment editing is enabled by default. canCreate Booleanreadonly. Convenience property that reads whether there are any editable layers that support the ...
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