Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on-tap does not cause paper-input value to be committed #890

Closed
Will-in-BC opened this issue Nov 6, 2014 · 2 comments
Closed

on-tap does not cause paper-input value to be committed #890

Will-in-BC opened this issue Nov 6, 2014 · 2 comments
Assignees

Comments

@Will-in-BC
Copy link

Hi,

I am using Polymer as installed by bower from the website. Release shows as 0.4.2 in the bower json file. (sorry I am new to bower so hopefully got that right).

I have a paper-input element and a paper-button. My understanding is that the value in the paper-input element should be committed when the element is blurred (loses focus). If the current value of the paper-input is 3 and I change this to 4 and click the button the behaviour is correct and the value of paper-input is 4. If however I tap the button the value seems not to be committed and remains as 3.

I have observed the on-tap behaviour on both a Chromebook and a Nexus 7 (with Chrome as the Browser).

Below is code to recreate the problem. Enter 1 in the ID element the click the button. You should see alert 1. Now enter 2 and click the button -- you should see 2. Now enter 3 and tap the button -- you should see 2 rather than the expected result of 3.

Here is the code.


<!--
    Use the template tag to wrap your Polymer elements with data binding: Will Hopkins
  -->

  <!doctype html>
  <html>
  <head>

    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">

    <title>paper-input</title>

<!--
    Update the following script and links to reflect your Polymer element locations
  -->



  <script src="/polymer/platform/platform.js"></script>

  <link href="/polymer/font-roboto/roboto.html" rel="import">
  <link href="/polymer/paper-input/paper-input.html" rel="import">
  <link href="/polymer/paper-button/paper-button.html" rel="import">

  <style shim-shadowdom>

  body {
    font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
    margin: 0;
    padding: 24px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
  }

  paper-input.narrow {
    width: 150px;
  }

  paper-tabs {
    background-color: #00bcd4;
    color: #fff;
    box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2);
  }
  </style>

</head>
<body unresolved>
  <div>
    <section>
      <template id="user-maintenance" is="auto-binding">

        <div><paper-input class="disableWaitingforResponse"label="ID" floatinglabel=true type=number value="{{iD}}"></paper-input></div>
        <div>
          <paper-button raised class="disableWaitingforResponse" id="createButton" on-tap="{{createClicked}}">Create</paper-button>
        </div>
      </template>
    </section>
  </div>
  <script>
  var inlineBinding = document.getElementById('user-maintenance');
  inlineBinding.createClicked = function() {
    alert("Create fired for: " + inlineBinding.iD);
  };

  </script>
</body>

@morethanreal morethanreal self-assigned this Nov 6, 2014
@Will-in-BC
Copy link
Author

Hi morethanreal,

Thanks for picking up my issue.

I reinstalled polymer using #master after all the bower commands and the example I gave now works as expected so my issue was addressed somewhere along the line after 0.4.2..

I can see that versioning is an issue as we work with Polymer and try and do a good job of reporting bugs.If I can make a suggestion it would be very nice to include something in each element that gives a clear indication of the version -- I could suggest just a simple text file in the folder of each element. I am a bit of a newbie in this world so if version labelling at the element level is already there please forgive my ignorance.

Will

ps I retested on both my Nexus 7 and Chromebook devices.

@morethanreal
Copy link
Contributor

It's a good idea to include a version with the source. In the meantime, you can use bower info <package> to find the version of a particular element if you installed from bower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants