You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use buttons for the Align formatter instead of the dropdown. I found #170 for the issue and was able to get it working with the value attribute (as mentioned in the Breaking Changes).
However, I can't figure out how to get the default "left" align to become active correctly. It should be active by default, so I leave out the value. However, it isn't active by default. It only becomes active after another align format is activated. Then both align formats are active.
I did a bit of debugging and it looks like it's an issue in the modules/toolbar.js:
There's no align format by default, so nothing gets activated. Say the align format with the value "center" is applied. The "center" button is activated since it has a value and matches the format. It also activates "left" button since it doesn't have a value, but there is a format for "align".
As a workaround, I added the value "left" to the left align format (and the whitelist). That fixes multiple buttons being activated, but it still doesn't highlight "left" by default (or if there is no align format).
I'm not sure what the best way to fix this is, though. I think there needs to be a way to say that an item is active if it does not have the format. So as long as there isn't an "align" format, the "left" align format is active.
I'm trying to use buttons for the Align formatter instead of the dropdown. I found #170 for the issue and was able to get it working with the
value
attribute (as mentioned in the Breaking Changes).However, I can't figure out how to get the default "left" align to become active correctly. It should be active by default, so I leave out the
value
. However, it isn't active by default. It only becomes active after another align format is activated. Then both align formats are active.I did a bit of debugging and it looks like it's an issue in the
modules/toolbar.js
:There's no align format by default, so nothing gets activated. Say the align format with the value "center" is applied. The "center" button is activated since it has a value and matches the format. It also activates "left" button since it doesn't have a value, but there is a format for "align".
As a workaround, I added the value "left" to the left align format (and the whitelist). That fixes multiple buttons being activated, but it still doesn't highlight "left" by default (or if there is no align format).
I'm not sure what the best way to fix this is, though. I think there needs to be a way to say that an item is active if it does not have the format. So as long as there isn't an "align" format, the "left" align format is active.
Steps for Reproduction
Expected behavior: Only the "center" align format is highlighted
Actual behavior: Both the "left" and "center" align formats are highlighted
Platforms: Chrome 51
Version: 1.0.0-beta6
The text was updated successfully, but these errors were encountered: