I am actually working on an Ionic 3 project but it could be any Javascript framework for the issue I am actualy facing :
According to a custom notifification bar appaearing on click (top right of the screen), you can actually close that notif bar clicking again on the same button but the UX is really bad in that way.
What I would like to expect: the user could click anywhere in the screen to hidethat notifications bar
I know how to do that in jquery but I don't want to use it in that project :
notif.html:
<ion-button (click)="toggleNotifications()">
<div class="notif-button" id="notif-button"></div>
</ion-button>
notif.ts (jQuery way):
$('#notif-button').click(function(e){
e.stopPropagation();
$('#hide-notif').toggleClass('show-notif');
});
$('#hide-notif').click(function(e){
e.stopPropagation();
});
$('body,html').click(function(e){
$('#hide-notif').removeClass('show-notif');
});