Bug Press Enter on input type=text triggered the onclick of backbutton in navigator.js


  • Hi,

    I think I found a bug with navigator.js and back button. I create a new Visual Studio Javascript project "Split App".

    I add in /pages/split/split.html just a input type="text" like 

    <div class="articlesection" aria-atomic="true" aria-label="Item detail column" aria-live="assertive">
    <!-- just insert a input text -->            
    <input type="text" />
    <!-- end -->
                    <header class="header">
                        <div class="text">
                            <h2 class="article-title win-type-ellipsis" data-win-bind="textContent: title"></h2>
                            <h4 class="article-subtitle" data-win-bind="textContent: subtitle"></h4>
                        <img class="article-image" src="#" data-win-bind="src: backgroundImage; alt: title" />
                    <div class="article-content" data-win-bind="innerHTML: content"></div>

    When I focus my input with left click and I press the ENTER key, the event onclick of back button is triggered (/js/navigator.js line 105) and the nav.back() is executed.

    I don't understand why ? My focus is normally on the input.

    Any idea ?


    • Edited by emorvill Tuesday, July 17, 2012 12:47 PM
    Tuesday, July 17, 2012 12:46 PM


  • http://adamkinney.com/blog/2012/06/18/why-your-winjs-app-may-navigate-back-when-a-textbox-is-in-focus-and-you-hit-enter/
    • Marked as answer by emorvill Tuesday, July 17, 2012 2:10 PM
    Tuesday, July 17, 2012 1:29 PM