Just playing around trying to incorporate the new context menus into my app.
Ran into a couple of bugs, still trying to reproduce some.
Here's a fairly big one though:
Context menus don't play well with bb.PushScreen and bb.PopScreen.
See example here: https://github.com/mikefromcanada/bbui-context
Context menu item pushes new screen
Back button clicked on new screen
Context menu now shows duplicate items
Items keep increasing if you repeat the actions.
Make sure you have the absolute latest.. The duplicate problem was fixed with the following commit at the beginning of last week. 6a0a108
Can you confirm that you have the latest and if the issue persists
I'm using version 0.9.6.125 which I believe is the most recent build. Issue still persists
I am getting the same issue in my app. Using 0.9.6.125
[Update] Just tried packaging my app using the bbUI.js file instead of the minified bbui-min.js. The bug is gone.
Scratch that, I'm still getting the bug, sorry for multi-posting.
Strange.. I hadn't been able to reproduce that.. I'll mark this for investigation
Another update that might help:
The duplicate items appear on every context menu in the application.
Is there a stack of items that's not getting cleared properly?
For example, in my app I have a total of 3 pages with separate context menus.
When I create a duplicate item by using bb.popScreen on one screen, that duplicate shows up in all 3 context menus in the app.
Yeah, that's the strange part.. I tested that a couple times, found a problem and fixed it. So it is weird that it is still happening for others. I'm going to look into it.
The webworks context menu is one menu that can be manipulated. The bbUI code is designed to clear the menu first before it is shown each time the event fires. So something is going wrong with the clearing code.
Seeing the same thing on the app I am working on after upgrading to .125.
Hmm.. question for you guys.. Are you also including the bbUI BB10 webworks extension that is needed for the bbUI context menu to work. Details are outlined in the Prerequisites section of the context menu documentation.
I am, yes. Before also including those files my app would not load at all
Same here. I wasn't able to load the app without doing so as well.
Same here. Are you still not able to reproduce Tim?
It was just something that I thought of. I won't be back in the office until Monday to try and track down the issue.
Really strange, I cannot reproduce it here. Can you try it with the sample in the repo.. go into the context menu screen, back, go back into context menu screen. I don't get duplicates.
It will work in the scenario you gave, but that's not the scenario where the bug occurs. It happens when you push a screen on top of the context menu screen.
Main -> context menu -> back to main -> context menu --- won't cause the bug
Main -> context menu -> screen pushed from context menu -> back to context menu --- will cause the bug
My sample above is just the sample from the repo with everything else pulled out and a blank bb.pushScreen added to the context menu screen.
ah.. got it.. I'll give that a try
fixed duplicate context menu items for issue #746
Ok.. this should now be fixed.. I was able to reproduce the scenario, and from testing the latest update will solve the problem