DominoKit/domino-ui

Dialog.addCollapseListener(CollapseHandler) should be called addCollapseHandler(CollapseHandler)

Closed this issue · 1 comments

mP1 commented

IM using a Dialog and i wanted to know when the user closed a dialog via ESC etc.

My code had a fragment similar to

Dialog.create()
  .addCollapseListener(this::onClose)

But my onClose was not being called.

Turns out there are two overloads:

  • addCollapseListener(CollapseHandler)
  • addCollapseListener(CollapseListener)

My bad luck was i thought the compiler was passing my method reference to Dialog.addCollapseListener(CollapseListener) , but i was actually registering a CollapseHandler to Dialog.addCollapseListener(CollapseHandler) and CollapseHandlers are not fired by Dialog.close/onClose.

The old interface have been deprecated and a new interface with more accurate naming is added, instead of expand/collapse now uses Open/Close.