Skip to content

Commit

Permalink
Bind handleExpansionToggleDblClickEvent in TreeWidget (#9877)
Browse files Browse the repository at this point in the history
Ensure `handleExpansionToggleDblClickEvent` correctly bound in TreeWidget

Co-authored-by: Scott Axcell <[email protected]>
  • Loading branch information
Scott Axcell and Scott Axcell authored Aug 13, 2021
1 parent 926a8af commit efd8263
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- [core] registering toolbar items for commands that explicitly target a `ViewContainer` rather than a child widget may not behave as expected. Such registrations should be made in the `ViewContainer` by overriding the `updateToolbarItems` method and using the `registerToolbarItem` utility. See the modifications to the `scm` and `vsx-registry` packages in the PR for examples. [#9798](https://github.com/eclipse-theia/theia/pull/9798)
- [vsx-registry] `VSXExtensionsContribution` no longer implements `TabBarToolbarContribution` and is not bound as such. Extensions of the class that expect such behavior should reimplement it with caution. See caveats in PR. [#9798](https://github.com/eclipse-theia/theia/pull/9798)
- [core] `handleExpansionToggleDblClickEvent` in `TreeWidget` can no longer be overridden. Instead, `doHandleExpansionToggleDblClickEvent` can be overridden. [#9877](https://github.com/eclipse-theia/theia/pull/9877)

## v1.16.0 - 7/29/2021

Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/browser/tree/tree-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1208,9 +1208,13 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {

/**
* Handle the double-click mouse event on the expansion toggle.
*/
protected readonly handleExpansionToggleDblClickEvent = (event: React.MouseEvent<HTMLElement>) => this.doHandleExpansionToggleDblClickEvent(event);
/**
* Actually handle the double-click mouse event on the expansion toggle.
* @param event the double-click mouse event.
*/
protected handleExpansionToggleDblClickEvent(event: React.MouseEvent<HTMLElement>): void {
protected doHandleExpansionToggleDblClickEvent(event: React.MouseEvent<HTMLElement>): void {
if (this.props.expandOnlyOnExpansionToggleClick) {
// Ignore the double-click event.
event.stopPropagation();
Expand Down

0 comments on commit efd8263

Please sign in to comment.