镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

CKEditor in map field to loop through repeater field only loads first editor #85

Open

Description

@hassnainabass

CKEditor in map field to loop through repeater field only loads first editor and throughs this error
Uncaught TypeError: Cannot read properties of null (reading 'unselectable')

{menu.map((item, index) => (


<div className="row" style={{marginTop:'20px'}}>
<div className={"col " + (lang=='en' ? '' : 'hide')}>
Menu(En)
<CKEditor
activeClass="p10"
content={item.menuEn}
config = {{
allowedContent : true
}}
id={'menuen'+index}
events={{
"blur": (e)=>setMenuEn(e.editor.getData(), index, menu),
"afterPaste": (e)=>setMenuEn(e.editor.getData(), index, menu),
"change": (e)=>setMenuEn(e.editor.getData(), index, menu)
}}
/>

<div className={"col " + (lang=='fr' ? '' : 'hide')}>
Menu(Fr)
<CKEditor
activeClass="p10"
config = {{
allowedContent : true
}}
id={'menufr'+index}
content={item.menuFr}
events={{
"blur": (e)=>setMenuFr(e.editor.getData(), index, menu),
"afterPaste": (e)=>setMenuFr(e.editor.getData(), index, menu),
"change": (e)=>setMenuFr(e.editor.getData(), index, menu),
}}
/>


<div className="row" style={{marginTop:'20px', marginBottom: "20px"}}>

<button className="btn btn-sm btn-danger" onClick={e => delMenu(e, menu, index)}>Delete





))}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions