Closed ssliman closed 7 years ago
Hi sliman180 !
Thank you, hope the documentation is clear enough, pretty new.
The only reason I see where the event binding wouldn't work, is that you probably put the numberClick
function in a separate component file ?
If that's the case and you need to listen to event, you'll need to use a subscriber :-)
IonDigitKeyboard.onClick.subscribe((key) => {
console.log('From subscriber: ', key);
})
I cloned your project as a demo. The key event doesn't fire. I didn't change any code in your project. Can you test it when you have time?
Thanks!
Oh ok sorry. I did it before my last answer actually. It does work, that's why I was wondering. Any error in the console ?
Nope, no errors in the console. I'll figure it out somehow. Thanks for your time!
Hi, thanks for this plugin.. i have the same issue this events don't fire numberClick or buttonClick, i tested that on this repo ! ?
regards
Hi, i think this events don't fire when testing on browser enough because this event [ (touchend) ] in template [ ion-digit-keyboard.html ] don't work and when changed it to [ (click) ] i can now listen to output events, it's strange because this (touchend) event should work on browser when develop the app touchend
regards
Hi mohamdio !
You're right, haven't thought about it since I'm using the Chrome Mobile Device Mode 99% of the time, and indeed touchend
doesn't work in Normal Mode.
It seems there is no way to detect it using javascript, so I won't be able to log something to developers...
Regarding the event it-self, I recommend you to keep touchend
, the click
event is damn slow on mobile devices.
@skol-pro Sure i will back to (touchend) event, so everything working fine now .. thank you 👍
@skol-pro @mohamdio Is it possible to use the (tap)
event from ionic 2? Or combining the directive tappable
with (click)
? Is that a good aproach?
regards
@sliman180 Well, if I'm right, the tap
event could work, however, the physical event must be a real tap, that means that if the user touch the screen for more than 300ms
or something, it won't call anything. Matter of taste, but from my experience, the touchend
event was the best, actually I made it to act like the iOS locked screen keyboard.
The click
event must definitely be avoided on mobiles.
For the keyboard plugin, I could create a directive that check if we're on mobile or not, and/or add a option parameter for the event to be used.
@skol-pro Yeah, that's true, now I understand why you use it.. You have a point there. It could be nice to have that directive. I appreciate your awesome work! 👍
@sliman180 He he, made with love and for fun :-) I'll see for the directive asap 👍
Hi @skol-pro ! Any news about implementing a mix of click/touchend depending on the platform? Thanks :)
Hi, thanks for the beautiful keyboard.
I got one issue the events don't work for me. I cloned your project and tested it there. It doesn't log the key inputs.
for example this function
numberClick(key: number) { console.log('From event: ', key); }
Am i missing something? I followed the docs from top to bottom.
Thanks in advance!