Tradeshift / tradeshift-ui

The Tradeshift UI Library & Framework
https://ui.tradeshift.com
Other
33 stars 45 forks source link

[Aside] Aside.onclose() should cancel on return false #255

Closed wiredearp closed 7 years ago

wiredearp commented 7 years ago

@sampi @zdlm @wejendorp

And the same goes for Notificatons and Dialogs and the SideBar in mobile breakpoint and I guess the DatePicker and the standard select picker and what not: It is a pattern that the Flux/Redux store can be the single source of truth for UI state and thus the automatic closing of components can be considered an illegal mutation of state; this would happen onclick the closing X, onclick the aside cover and onkeypress ESCAPE.

This should already be possible according to https://github.com/Tradeshift/tradeshift-ui/blob/master/src/runtime/js/ts.ui/core/core-gui%40tradeshift.com/spirits/asides/ts.ui.SideShowSpirit.js#L633 and https://github.com/Tradeshift/tradeshift-ui/blob/master/src/runtime/js/ts.ui/core/core-gui%40tradeshift.com/spirits/asides/ts.ui.AsideSpirit.js#L393, but apparently this doesn't really work so great, because the general UI (and the cover in particular) is not aware of the return value.

wejendorp commented 7 years ago

Nice summary, I have no more to add. Let me know when there's anything to test.