toniantunovi / ion-bottom-drawer

Bottom drawer component for Ionic 4
63 stars 16 forks source link

Add class flag when drawer state changed #22

Closed frankyso closed 3 years ago

frankyso commented 5 years ago

i think its better to add flag like css to ion-bottom-drawer components, when the drawer changed like top, docked, bottom.

to make the drawer easier to styling.

sorry for my english.

SirBenedick commented 5 years ago

The ion-bottom-drawer emits an event when its state changes. You could listen to it and style accordingly.

Just listen to the "stateChange" event and trigger your own method. In this example when the state is changed the "changedState()" method gets called with the "$event" parameter.

<ion-bottom-drawer
  [...]
  (stateChange)="changedState($event)"
>
[...]
</ion-bottom-drawer>

Or you can use a directive which customizes the ion-bottom-drawer on state change