locked
data-win-selectable vs contenteditable: showing default context menu

    Question

  • Hello guys.

    According to the docs, there are default context menus for text and hyperlinks. For text, the default context menu should show the basic clipboard commands. In order to test this, I've started by adding a textarea to my app. And sure enough, right clicking over selected text ended up showing me the default clipboard commands (copy, cut, paste) in a context menu.

    I've decided to test other elements and I've started by adding a p element. Since by default you can't select text from it, I've went ahead and applied the data-win-selectable attribute to that p element. Now, I can only see one action (copy) when I right click the selected text.  It mae sense because p is editable. The docs say that all the elements with the contenteditable attribute set to true are selectable.

    So, I've went ahead and replaced the data-win-selectable attribute with the contenteditable attribute. And yes, I can still select the text (or even change the text of my p element), but now selecting the text and right clicking over the selection ends up showing only the appbar instead of the default context menu (which I expected to hold the copy, cut and paste command since the element is editable). I've also tried adding the data-win-selectable but I still can't see the default context menu. The only way I'm able to get it back is by removing the contenteditable atribute from my p element. I've tried using a div and I've ended up with the same results. Is this a bug? Did I miss something in the docs?

    Last question: right clicking over the selected text will also show me the appbar. Is this a bug? will this be the default behavior? shouldn't showing the default context menu stop the right click event propagation?

    thanks.


    Luis Abreu
    Wednesday, January 11, 2012 12:59 PM

Answers

All replies

  • Hi Luis,

    Thanks for the great description of the problem!

    The contenteditable context menu problem is a known issue and a bug has already been filed for that.  Thanks for reporting it!

    The appbar issue is a know issue as well.

    -Jeff


    Jeff Sanders (MSFT)
    Wednesday, January 11, 2012 3:54 PM
    Moderator
  • Hello Jeff.

    Does that mean that these issues will be fixed in the final release?


    Luis Abreu
    Thursday, January 12, 2012 8:58 AM
  • Hi Luis,

    We cannot speculate about what has not been publically disclosed yet.  Sorry.

    -Jeff


    Jeff Sanders (MSFT)
    Thursday, January 12, 2012 1:08 PM
    Moderator
  • Hello again Jeff.

    but I don't want you to speculate. If those are bugs, I just wanted to know if they've been marked for fixing in the next release :)


    Luis Abreu
    Friday, January 13, 2012 11:23 AM
  • Nice try my friend :-)

    You will have to wait and see if they are fixed in future releases.

    -Jeff


    Jeff Sanders (MSFT)
    Friday, January 13, 2012 12:32 PM
    Moderator
  • -:)

    It seems like i'll have to keep trying ;)


    Luis Abreu
    Friday, January 13, 2012 1:00 PM