Skip to content

Commit 01f7b74

Browse files
committedApr 27, 2020
Remove Correct Automatically menu item
It didn’t work like expected. It should have enabled auto-correction, but there’s no way to do that in Electron. Instead, it just corrected the first word, which is weird and also not very useful. Fixes #101
1 parent 56d6df3 commit 01f7b74

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed
 

‎index.d.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ import {
1111

1212
declare namespace contextMenu {
1313
interface Labels {
14-
/**
15-
@default 'Correct Automatically'
16-
*/
17-
readonly correctAutomatically?: string;
18-
1914
/**
2015
@default 'Learn Spelling'
2116
*/
@@ -94,7 +89,6 @@ declare namespace contextMenu {
9489

9590
interface Actions {
9691
readonly separator: () => MenuItemConstructorOptions;
97-
readonly correctAutomatically: (options: ActionOptions) => MenuItemConstructorOptions;
9892
readonly learnSpelling: (options: ActionOptions) => MenuItemConstructorOptions;
9993
readonly lookUpSelection: (options: ActionOptions) => MenuItemConstructorOptions;
10094
readonly searchWithGoogle: (options: ActionOptions) => MenuItemConstructorOptions;
@@ -252,7 +246,7 @@ declare namespace contextMenu {
252246
253247
To get spellchecking, “Correct Automatically”, and “Learn Spelling” in the menu, please enable the `spellcheck` preference in browser window: `new BrowserWindow({webPreferences: {spellcheck: true}})`
254248
255-
@default [...dictionarySuggestions, defaultActions.separator(), defaultActions.correctAutomatically(), defaultActions.separator(), defaultActions.learnSpelling(), defaultActions.separator(), defaultActions.lookUpSelection(), defaultActions.separator(),defaultActions.searchWithGoogle(), defaultActions.cut(), defaultActions.copy(), defaultActions.paste(), defaultActions.separator(), defaultActions.saveImage(), defaultActions.saveImageAs(), defaultActions.copyLink(), defaultActions.copyImage(), defaultActions.copyImageAddress(), defaultActions.separator(), defaultActions.copyLink(), defaultActions.separator(), defaultActions.inspect()]
249+
@default [...dictionarySuggestions, defaultActions.separator(), defaultActions.separator(), defaultActions.learnSpelling(), defaultActions.separator(), defaultActions.lookUpSelection(), defaultActions.separator(),defaultActions.searchWithGoogle(), defaultActions.cut(), defaultActions.copy(), defaultActions.paste(), defaultActions.separator(), defaultActions.saveImage(), defaultActions.saveImageAs(), defaultActions.copyLink(), defaultActions.copyImage(), defaultActions.copyImageAddress(), defaultActions.separator(), defaultActions.copyLink(), defaultActions.separator(), defaultActions.inspect()]
256250
*/
257251
readonly menu?: (
258252
defaultActions: Actions,

‎index.js

-10
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ const create = (win, options) => {
4141

4242
const defaultActions = {
4343
separator: () => ({type: 'separator'}),
44-
correctAutomatically: decorateMenuItem({
45-
id: 'correctAutomatically',
46-
label: 'Correct Spelling Automatically',
47-
visible: props.isEditable && hasText && props.misspelledWord && props.dictionarySuggestions.length > 0,
48-
click() {
49-
const target = webContents(win);
50-
target.insertText(props.dictionarySuggestions[0]);
51-
}
52-
}),
5344
learnSpelling: decorateMenuItem({
5445
id: 'learnSpelling',
5546
label: 'Learn Spelling',
@@ -231,7 +222,6 @@ const create = (win, options) => {
231222
defaultActions.separator(),
232223
...dictionarySuggestions,
233224
defaultActions.separator(),
234-
defaultActions.correctAutomatically(),
235225
defaultActions.separator(),
236226
defaultActions.learnSpelling(),
237227
defaultActions.separator(),

‎readme.md

-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ The following options are ignored when `menu` is used:
221221
Default actions:
222222

223223
- `spellCheck`
224-
- `correctAutomatically`
225224
- `learnSpelling`
226225
- `separator`
227226
- `lookUpSelection`

0 commit comments

Comments
 (0)
Please sign in to comment.