event.inputType not available in Firefox
I have following Angular 5 code working on Safari and Chrome but not on Firefox(63). How to fix this problem.? (Clearly because firefox event object doesn't have the inputType
property.
<input (focus)="onInputFocus()" (keydown)="onKeyDown($event)"(input)="onSearchChange($event)" type="text" id="example-search-input">
onSearchChange(event) {
if (event.inputType === 'deleteContentBackward' || event.inputType === 'insertText' ) {
// This code block doesn't get called at all in firefox.
}
}
event object on chrome.
InputEvent {
data:"e",
dataTransfer:null,
defaultPrevented:true,
detail:0,
eventPhase:0,
inputType:"insertText",
isComposing:false,
isTrusted:true,
path:(14) [
input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
div.col-md-7.search-input-container,
div.col-12.no-padding.search.custom-search-box,
div.input-group.col-lg-6.col-md-6.col-sm-7.col-xs-12,
div.search-section.col-12,
div.container,
app-search-header,
div.container,
section.intro,
app-root,
body,
html.no-js,
document,
Window
],
returnValue:false,
sourceCapabilities:null,
srcElement:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
target:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
type:"input",
view:null,
which:0
}
event object on firefox.
{
defaultPrevented:false,
detail:0,
eventPhase:0,
explicitOriginalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
isComposing:false,
isTrusted:true,
layerX:0,
layerY:0,
originalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
pageX:0,
pageY:306,
rangeOffset:0,
rangeParent:null,
returnValue:true,
srcElement:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
target:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
view: Window http: //localhost:4200 /search-results,
which:0
}
Some clearly irrelevant elements in the objects were omitted to keep the post shorter.
firefox events angular5
add a comment |
I have following Angular 5 code working on Safari and Chrome but not on Firefox(63). How to fix this problem.? (Clearly because firefox event object doesn't have the inputType
property.
<input (focus)="onInputFocus()" (keydown)="onKeyDown($event)"(input)="onSearchChange($event)" type="text" id="example-search-input">
onSearchChange(event) {
if (event.inputType === 'deleteContentBackward' || event.inputType === 'insertText' ) {
// This code block doesn't get called at all in firefox.
}
}
event object on chrome.
InputEvent {
data:"e",
dataTransfer:null,
defaultPrevented:true,
detail:0,
eventPhase:0,
inputType:"insertText",
isComposing:false,
isTrusted:true,
path:(14) [
input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
div.col-md-7.search-input-container,
div.col-12.no-padding.search.custom-search-box,
div.input-group.col-lg-6.col-md-6.col-sm-7.col-xs-12,
div.search-section.col-12,
div.container,
app-search-header,
div.container,
section.intro,
app-root,
body,
html.no-js,
document,
Window
],
returnValue:false,
sourceCapabilities:null,
srcElement:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
target:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
type:"input",
view:null,
which:0
}
event object on firefox.
{
defaultPrevented:false,
detail:0,
eventPhase:0,
explicitOriginalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
isComposing:false,
isTrusted:true,
layerX:0,
layerY:0,
originalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
pageX:0,
pageY:306,
rangeOffset:0,
rangeParent:null,
returnValue:true,
srcElement:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
target:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
view: Window http: //localhost:4200 /search-results,
which:0
}
Some clearly irrelevant elements in the objects were omitted to keep the post shorter.
firefox events angular5
add a comment |
I have following Angular 5 code working on Safari and Chrome but not on Firefox(63). How to fix this problem.? (Clearly because firefox event object doesn't have the inputType
property.
<input (focus)="onInputFocus()" (keydown)="onKeyDown($event)"(input)="onSearchChange($event)" type="text" id="example-search-input">
onSearchChange(event) {
if (event.inputType === 'deleteContentBackward' || event.inputType === 'insertText' ) {
// This code block doesn't get called at all in firefox.
}
}
event object on chrome.
InputEvent {
data:"e",
dataTransfer:null,
defaultPrevented:true,
detail:0,
eventPhase:0,
inputType:"insertText",
isComposing:false,
isTrusted:true,
path:(14) [
input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
div.col-md-7.search-input-container,
div.col-12.no-padding.search.custom-search-box,
div.input-group.col-lg-6.col-md-6.col-sm-7.col-xs-12,
div.search-section.col-12,
div.container,
app-search-header,
div.container,
section.intro,
app-root,
body,
html.no-js,
document,
Window
],
returnValue:false,
sourceCapabilities:null,
srcElement:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
target:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
type:"input",
view:null,
which:0
}
event object on firefox.
{
defaultPrevented:false,
detail:0,
eventPhase:0,
explicitOriginalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
isComposing:false,
isTrusted:true,
layerX:0,
layerY:0,
originalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
pageX:0,
pageY:306,
rangeOffset:0,
rangeParent:null,
returnValue:true,
srcElement:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
target:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
view: Window http: //localhost:4200 /search-results,
which:0
}
Some clearly irrelevant elements in the objects were omitted to keep the post shorter.
firefox events angular5
I have following Angular 5 code working on Safari and Chrome but not on Firefox(63). How to fix this problem.? (Clearly because firefox event object doesn't have the inputType
property.
<input (focus)="onInputFocus()" (keydown)="onKeyDown($event)"(input)="onSearchChange($event)" type="text" id="example-search-input">
onSearchChange(event) {
if (event.inputType === 'deleteContentBackward' || event.inputType === 'insertText' ) {
// This code block doesn't get called at all in firefox.
}
}
event object on chrome.
InputEvent {
data:"e",
dataTransfer:null,
defaultPrevented:true,
detail:0,
eventPhase:0,
inputType:"insertText",
isComposing:false,
isTrusted:true,
path:(14) [
input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
div.col-md-7.search-input-container,
div.col-12.no-padding.search.custom-search-box,
div.input-group.col-lg-6.col-md-6.col-sm-7.col-xs-12,
div.search-section.col-12,
div.container,
app-search-header,
div.container,
section.intro,
app-root,
body,
html.no-js,
document,
Window
],
returnValue:false,
sourceCapabilities:null,
srcElement:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
target:input#example-search-input.form-control.custom-input.ng-valid.ng-dirty.ng-touched,
type:"input",
view:null,
which:0
}
event object on firefox.
{
defaultPrevented:false,
detail:0,
eventPhase:0,
explicitOriginalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
isComposing:false,
isTrusted:true,
layerX:0,
layerY:0,
originalTarget:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
pageX:0,
pageY:306,
rangeOffset:0,
rangeParent:null,
returnValue:true,
srcElement:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
target:<input id="example-search-input" class="form-control custom-input ng-valid ng-dirty ng-touched" _ngcontent-c2="" placeholder="What are you looking for ?" type="text" ng-reflect-model="e">,
view: Window http: //localhost:4200 /search-results,
which:0
}
Some clearly irrelevant elements in the objects were omitted to keep the post shorter.
firefox events angular5
firefox events angular5
asked Nov 22 '18 at 5:37
Ammar Ibnu AmeerdeenAmmar Ibnu Ameerdeen
4301315
4301315
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424488%2fevent-inputtype-not-available-in-firefox%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53424488%2fevent-inputtype-not-available-in-firefox%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown