Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13378 closed defect (fixed)

ToolBarButton - Meaning of select() method is reversed

Reported by: Ming Zhe Huang Owned by: ykami
Priority: high Milestone: 1.7
Component: DojoX Mobile Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by ykami)

The meaning of select() method is reversed. When writing the following code to deselect a toolbar button, actually we're selecting it.

toggleBtn.select(false); try to deselect, but actually select

Check ToolBarButton.js line 58, the passed in parameter name is "deselect". I think it should be renamed as "select".

Change History (4)

comment:1 Changed 8 years ago by Ming Zhe Huang

BTW, the meaning of ToolBarButton?.selected is also reversed here. That will cause trouble if there's need to check that flag.

comment:2 Changed 8 years ago by ykami

Description: modified (diff)
Milestone: tbd1.7
Status: newassigned

Thanks, I agree. The API was not good. It has to be consistent.

comment:3 Changed 8 years ago by ykami

Resolution: fixed
Status: assignedclosed

(In [25736]) Fixes #13378 !strict Made the select API consistent. TabBarButton? and ToolBarButton? had select(Boolean), while ListItem? had select/deselect. Added deselect to TabBarButton? and ToolBarButton?. The boolean argument for select() is still valid to keep backward compatibility.

comment:4 Changed 8 years ago by ykami

(In [25859]) Refs #13378 !strict Fixed the toggle button logic in defaultClickAction.

Note: See TracTickets for help on using tickets.