File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,13 @@ class ButtonParagraphAlign extends React.Component {
3030 render ( ) {
3131 let buttonCommandsList ;
3232 let buttonCommandsListId ;
33+ const getCommands = this . _getCommands ( ) ;
3334
3435 if ( this . props . expanded ) {
3536 buttonCommandsListId = ButtonParagraphAlign . key + 'List' ;
3637 buttonCommandsList = (
3738 < ButtonCommandsList
38- commands = { this . _getCommands ( ) }
39+ commands = { getCommands }
3940 inlineIcons = { false }
4041 listId = { buttonCommandsListId }
4142 onDismiss = { this . props . toggleDropdown }
@@ -45,14 +46,16 @@ class ButtonParagraphAlign extends React.Component {
4546
4647 const editor = this . context . editor . get ( 'nativeEditor' ) ;
4748
48- const activeCommand = this . _getCommands ( )
49+ let activeCommand = getCommands
4950 . filter ( alignment => {
5051 const command = editor . getCommand ( alignment . command ) ;
5152
5253 return command ? command . state === CKEDITOR . TRISTATE_ON : false ;
5354 } )
5455 . pop ( ) ;
5556
57+ activeCommand = activeCommand ? activeCommand : getCommands [ 0 ] ;
58+
5659 const iconClassName = activeCommand . icon ;
5760
5861 return (
You can’t perform that action at this time.
0 commit comments