locked
space button in grouped listview RRS feed

  • Question

  • hello guys.

    I am developing metro app. I have grouped listview, and there is text input in header of this listview. when I type something in this text input and press "spacebar" - my input lost focus and I can't put spaces between words. But I need to put "empty space", and I know that "spacebar" is bound for selection in metro apps.

    Please help me with this issue.


    Wednesday, June 27, 2012 3:58 PM

Answers

  • This is the default behavior of ListView (and you text element is in the list view).

    You could try and do something fancy like override the behavior of the ListView for onkeydown or move the text box out of the list view.  You can also redesign your view to not use a list view in this case since you don't really need it in that particular view.

    To see the behavior you can put a BP in ui.js line 15726.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 2, 2012 6:34 PM
    Moderator

All replies

  • Can you provide us some sample code so we can see how you are using the ListView?  I am wondering if you have tried setting the selectionMode for the ListView:

    <div data-win-control="WinJS.UI.ListView" data-win-options="{ selectionMode : 'none'}" ></div>



    Dave Paquette @Dave_Paquette www.davepaquette.com

    Thursday, June 28, 2012 4:49 PM
  • Hi Dave.

    Thank you for your replay. I have created test project, that reproduces this error. here is link to download - http://www.filedropper.com/testapp

    After running solution please go to any group detail page, for example press link "Group Title: 1". I have added html input to header template. Try to type some text in this input and hit "spacebar" to add space between words. You'll lose focus.

    I have exactly the same issue.

    Friday, June 29, 2012 8:05 AM
  • Sorry MyKola,

    That site requires a credit or debit card to register.  Why don't you try something like SkyDrive instead to share your source.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 2, 2012 1:44 PM
    Moderator
  • Oh, I'm sorry, here is updated link for downloading.

    https://www.dropbox.com/s/g96pj7a485ahe1i/TestApp.zip

    Still waiting for help. I'll appreciate any advice.


    Monday, July 2, 2012 3:43 PM
  • Thanks!  I will look at this.

    Jeff Sanders (MSFT)

    Monday, July 2, 2012 4:04 PM
    Moderator
  • This is the default behavior of ListView (and you text element is in the list view).

    You could try and do something fancy like override the behavior of the ListView for onkeydown or move the text box out of the list view.  You can also redesign your view to not use a list view in this case since you don't really need it in that particular view.

    To see the behavior you can put a BP in ui.js line 15726.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 2, 2012 6:34 PM
    Moderator