Skip to content

Core | Notification issue: submitOnEnter = false failure #2618

@rtsawyer5

Description

@rtsawyer5

Environment

[Core]
  onsenui latest
  
[Platform]
  Desktop - Windows 10 64-bit

[Browser]
  Desktop - Chrome 71.0.3578.98 on Windows 10 64-bit

Encountered problem
When using the ons.notification.prompt option submitOnEnter, if set to false, an error is produced and the callback is not launched.

How to reproduce
set submitOnEnter = false in ons.notification.prompt options

Demo link

  • HTML
<ons-page>
  <ons-button onclick="showAlert()">Alert</ons-button>
  <ons-button onclick="showConfirm()">Confirm</ons-button>
  <ons-button onclick="showPrompt()">Prompt</ons-button>
  <ons-button onclick="showToast()">Toast</ons-button>
</ons-page>
  • JS
var showAlert = function() {
  ons.notification.alert('Alert!');
};

var showConfirm = function() {
  ons.notification.confirm('Confirm!')
};

var showPrompt = function() {
  ons.notification.prompt('Prompt!',{
    submitOnEnter : false
  })
    .then(function(input) {
      var message = input ? 'Entered: ' + input : 'Entered nothing!';
      ons.notification.alert(message);
    });
};

var showToast = function() {
  ons.notification.toast('Toast!', {
    timeout: 2000
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions