Skip to content

Commit

Permalink
fix(electron): should not show context menu if there is no typos
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Nov 22, 2024
1 parent c6ac426 commit c078ae8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,12 @@ export class WebContentViewsManager {

if (spellCheckSettings.enabled) {
view.webContents.on('context-menu', (_event, params) => {
const shouldShow =
params.misspelledWord && params.dictionarySuggestions.length > 0;

if (!shouldShow) {
return;
}
const menu = new Menu();

// Add each spelling suggestion
Expand Down

0 comments on commit c078ae8

Please sign in to comment.