-
Notifications
You must be signed in to change notification settings - Fork 37
Hide ImageTextAlternative balloon when image element has been removed #138
Conversation
Shouldn't this issue be included in http://localhost:8125/ckeditor5-ui/tests/manual/contextualballoon/externalchanges.html or provide a new MT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes needed in tests.
tests/image/utils.js
Outdated
it( 'should return false when widget element is not the only element in the selection', () => { | ||
const notWidgetizedElement = new ViewElement( 'p' ); | ||
|
||
frag = new ViewDocumentFragment( [ notWidgetizedElement, notWidgetizedElement ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be new ViewDocumentFragment( [ element, notWidgetizedElement ] )
instead?
I was thinking about it but this is something that we are able to test by our unit tests. I think MT is useful to test repositioning because this is something we need to stub in unit tests. But I can add MT if you think is needed for this case. |
For one thing, I was surprised that the MT is in ckeditor5-ui instead of ckeditor5-link. The code which handles re-positioning and stuff on Then I thought that we should check the same thing in the image and I finally found out there's a corresponding test in the image too ckeditor5-image/tests/manual/tickets/106/1.html. It doesn't test this kind of issue because what is "remotely" removed is the paragraph before the image instead of the image widget itself. So maybe, let's just extend this MT and include this issue's case? |
I was using |
The MT is OK. But it revealed that the editor loses focus when the image which text alternative is being edited gets removed. This, I'm afraid, must be addressed (it works in the link feature because it explicitly calls focus). |
…moved by an external change.
Suggested merge commit message (convention)
Fix: Hide
ImageTextAlternative
balloon when image element has been removed by external changes. Closes ckeditor/ckeditor5#5115.