Skip to content

“Remove highlight” button is not following the highlight command disabled state #9174

Closed
@serhiiyanhol

Description

📝 Provide detailed reproduction steps (if any)

  1. Open highlight feature guide and scroll to "Inline buttons" sample.
  2. Disable the highlight command. You can do this by executing the following code document.querySelectorAll( '.ck-editor__editable' )[ 2 ].ckeditorInstance.commands.get( 'highlight' ).forceDisabled( 'someId' ).

✔️ Expected result

On disable Highlight plugin buttons in toolbar should become inactive.

❌ Actual result

“Remove highlight” button is still active.

image

📃 Other details

  • First affected CKEditor version: 24
  • Installed CKEditor plugins: default highlight

Possible solution:

_addRemoveHighlightButton() {
const t = this.editor.t;
const command = this.editor.commands.get( 'highlight' );
function decorateHighlightButton( button ) {
button.bind( 'isEnabled' ).to( command, 'isEnabled' );
}
this._addButton( 'removeHighlight', t( 'Remove highlight' ), eraserIcon, null, decorateHighlightButton );
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    domain:ui/uxThis issue reports a problem related to UI or UX.package:highlightsquad:coreIssue to be handled by the Core team.support:2An issue reported by a commercially licensed client.type:bugThis issue reports a buggy (incorrect) behavior.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions