Skip to content

Commit 01010ef

Browse files
committed
Moe press() call from mousedown to mouseup.
1 parent dcb452b commit 01010ef

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

ts/item_command.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* Unless required by applicable law or agreed to in writing, software
1212
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressor implied.
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
@@ -66,6 +66,24 @@ export class Command extends AbstractItem {
6666
super(menu, 'command', content, id);
6767
}
6868

69+
/**
70+
* @param {MouseEvent} event The mousedown event
71+
*/
72+
public mousedown(event: MouseEvent) {
73+
this.stop(event);
74+
}
75+
76+
/**
77+
* Do the press on mouseup so menu gets the mouse up rather than a dialog box
78+
* after the menu closes.
79+
*
80+
* @param {MouseEvent} event The mouseup event
81+
*/
82+
public mouseup(event: MouseEvent) {
83+
this.press();
84+
this.stop(event);
85+
}
86+
6987
/**
7088
* @override
7189
*/

0 commit comments

Comments
 (0)