-
Notifications
You must be signed in to change notification settings - Fork 42
Commands in secondary section not clickable #80
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
Comments
I have the same issue. If I look at the DOM I can see the following hidden markup in the win-commandingsurface-overflowareacontainer that has the ng-click set:
If I set visible to true a command shows up in the main app bar area and everything works as expected. The markup that is generated in the secondary area is however:
As you can see in the markup the ng-click is not copied to the secondary markup. |
This is related to a known issue in the current AppBar implementation. winjs/winjs#1196 Right now the only workaround is to set the onclick property on the AppBarCommand's For example: <win-appbar-command icon="'home'" label="'Home'" win-control="'iconCommand'">
</win-app-bar-command>
<win-app-bar-command type="'toggle'" icon="'world'" label="Earth" win-control="'toggleCommand'"></win-app-bar-command> // Now you can access your the AppBarCommand objects directly through the $Scope object.
$Scope.iconCommand.onclick = function(e){ console.log("click happens")};
$Scope.toggleCommand.onclick = function(e){
$Scope.toggleCommand.label = "Mars";
}; |
Specifically, any AppBarCommands that appear in the AppBar's overflow area will encounter this problem. This includes all secondary commands, and any primary commands that need to overflow when there is not enough room in the primary action area. |
Ok thank you @AmazingJaze for information and the workaround. I tried the workaround but I'm obviously doing something wrong since the property I give to win-control="" ends up in a nested child scope two levels down from the current controller scope. Any idea why? |
Thanks @AmazingJaze I couldn't get the example you provided here to work but was able to use the one provided at winjs/winjs#1196. |
So i have this snippet and commands with section="'secondary'" does not respond to click event but those assigned primary (or nothing at all) responds as expected.
Home works but Clock doesn't... Am I missing anything?
The text was updated successfully, but these errors were encountered: