Skip to content

Commit

Permalink
fix:prevent url hash changes when edit keybinding
Browse files Browse the repository at this point in the history
Signed-off-by: 二凢 <[email protected]>
  • Loading branch information
datou0412 authored and vince-fugnitto committed Sep 16, 2020
1 parent 32766c0 commit 64670d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/keymaps/src/browser/keybindings-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ export class KeybindingWidget extends ReactWidget {
* @param item the keybinding item for the row.
*/
protected renderEdit(item: KeybindingItem): React.ReactNode {
return <a title='Edit Keybinding' href='#' onClick={a => this.editKeybinding(item)}><i className='fa fa-pencil kb-action-item'></i></a>;
return <a title='Edit Keybinding' href='#' onClick={e => {
e.preventDefault();
this.editKeybinding(item);
}}><i className='fa fa-pencil kb-action-item'></i></a>;
}

/**
Expand All @@ -392,7 +395,10 @@ export class KeybindingWidget extends ReactWidget {
*/
protected renderReset(item: KeybindingItem): React.ReactNode {
return (item.keybinding && item.keybinding.scope === KeybindingScope.USER)
? <a title='Reset Keybinding' href='#' onClick={a => this.resetKeybinding(item)}><i className='fa fa-undo kb-action-item'></i></a> : '';
? <a title='Reset Keybinding' href='#' onClick={e => {
e.preventDefault();
this.resetKeybinding(item);
}}><i className='fa fa-undo kb-action-item'></i></a> : '';
}

/**
Expand Down

0 comments on commit 64670d7

Please sign in to comment.