Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Ng-keyup on Android doesn't fire on Space char(32)

$
0
0

@flyer299 wrote:

I have an app that watches the KeyUp event using ng-keyup(myFunction($event)) to detect a space. When the Space is pressed I execute some logic. This logic worked in my app in production on all form factors: (iOS & Android, plus testing in Ripple).

All of a sudden in my latest version it recognized all keypreses except for space. The only thing that changed in this part of the code was:

  • Upgraded to Ionic 1.2.3 from 1.1.0

I am using Angular Version 1.4.3 in both cases (Working and Non Working) (Best I can tell, I thought I upgraded Angular, but my Source Control says I didn't)

On iOS and Ripple it still detects the space. But on the android itself, it doesn't fire the keypress event at all. Or it does fire but leaves the $event.keyCode = the last letter pressed. I can't get a debugger on an android device, so I don't know.

Here are some Code to go with it:
<ion-item class="item-button-right">
<input type="text"
class="item-input"
style="width:100%"
placeholder="Type an Identifer Here..."
name="Flight.RouteOfFlight"
ng-model="state.AirportEntry"
ng-keyup="airportChange($event)"
zng-blur="airportChange(state.AirportEntry)">
<button class="button button-positive"
ng-click="searchAirport()"
type="button">
<i class="icon ion-chevron-right"></i>
</button>
</ion-item>

$scope.airportChange = function ($event) {

// $scope.lastKey = $event.keyCode;
if ($event.keyCode == 32) {
$scope.searchAirport();
} else {
curAirport += String.fromCharCode($event.keyCode);
}
};

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>