You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在pe:ckEditor中启用浏览器拼写检查功能

Solution for Enabling Native Browser Spell Check in pe:ckEditor

Got it, I’ve run into this exact issue with PrimeFaces Extensions’ pe:ckEditor before—since it’s a wrapped version of CKEditor, you can’t just edit a standalone config.js file, but there are two reliable ways to enable native spell check:

1. Use the config Attribute Directly (Simplest Approach)

pe:ckEditor actually supports passing raw CKEditor configuration options via its config attribute, using JSON syntax. This lets you set the disableNativeSpellChecker flag directly without any extra JS:

<pe:ckEditor id="emailEditor" value="#{yourBean.emailContent}"
              config='{"disableNativeSpellChecker": false}' />

This works because the component passes this JSON config directly to the underlying CKEditor instance during initialization.

2. Use the onClientLoad Callback (Fallback for Edge Cases)

If for some reason the config attribute doesn’t pick up the setting (rare, but possible with older pe:ckEditor versions), you can modify the editor instance directly after it loads:

First, add a client-side JavaScript function to your page:

function enableSpellCheck(editor) {
    // Disable CKEditor's native spell checker override
    editor.config.disableNativeSpellChecker = false;
    // Ensure the editable content element has spellcheck enabled
    editor.editable().setAttribute('spellcheck', 'true');
}

Then hook this function to the pe:ckEditor’s onClientLoad event:

<pe:ckEditor id="emailEditor" value="#{yourBean.emailContent}"
              onClientLoad="enableSpellCheck(this)" />

Quick Note

Don’t forget that users still need to have spell check enabled in their browser settings (most have this on by default), but these steps ensure the editor doesn’t block that functionality.

内容的提问来源于stack exchange,提问作者A.Alessio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 22:03:11