-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Hiding Buttons doesnt work as expected #27
Comments
If you have time to debug it, that would help because I don't currently have the time to look into it. What I could say though is that the problem might be on the line where it merge the editor default with your options, see this line, the merge of the editor options + your options, is supposed to result in your options still included. If you could troubleshoot that, it would help. |
Want to deploy the app on 1. of January. So I have to fix this issue by my own. I think it is just a minor issue...I will check this next week. Leaving you a message on progress. Cheers! |
Any solution you can share, @CR34L ? |
I found out in the meanwhile that when forking this repo, hiding buttons works in reactive-forms without any problems. But if you dynamically create forms (Dynamic Forms: https://angular.io/guide/dynamic-form), then hiding the buttons does not work anymore. |
@stefanwalther |
@ghiscoding Sure, if I find the issue ;-) |
Weird thing is that even this does not work: this.editorOptions = {
autofocus: false,
hiddenButtons: [],
onShow: (e: EditorInstance) => {
// @ts-ignore
e.hideButtons(['cmdBold']);
}
}; And But Again
|
Hi, I'm experiencing the same problem. Could you provide some way to change the color of the icons? Good work with this project. Edit: it seems that it is not the same problem, I proceed to open new issue. sorry for the inconvenience |
The best workaround I have found so far is the following: <angular-markdown-editor
... options
class="angular-markdown-editor-minimalistic"
... other options
></angular-markdown-editor> .angular-markdown-editor-minimalistic {
// See here: https://css-tricks.com/almanac/selectors/a/attribute/
::ng-deep [data-handler$="cmdBold"] {
display: none;
}
} Using then SCSS, I am doing the following, which always works to get a minimalistic version of the markdown-editor: .angular-markdown-editor-minimalistic {
$disabledButtons: cmdStrikethrough, cmdImage, cmdHeading, cmdUrl, cmdListO, cmdCode, cmdQuote, cmdTable, cmdPreview;
@each $disabledButton in $disabledButtons {
// See here: https://css-tricks.com/almanac/selectors/a/attribute/
::ng-deep [data-handler$="#{$disabledButton}"] {
display: none;
}
}
} Not ideal, but a well working workaround ;-) |
I'm submitting a bug report
2.0.2
Please tell us about your environment:
Operating System:
OSX 10.14.1
Browser:
all | Chrome | Safari
Language:
TypeScript 3.1.6
Current behavior:
Unable to hide Buttons with provided options:
this.editorOptions = { hiddenButtons: ['cmdUrl', 'cmdImage', 'cmdCode', 'cmdPreview']};
Disable Buttons with options works as expected:
this.editorOptions = { disabledButtons: ['cmdUrl', 'cmdImage', 'cmdCode', 'cmdPreview']};
Expected/desired behavior:
Hide Buttons as expected
The text was updated successfully, but these errors were encountered: