codex-team / codex-team/editor.js

Question: Dynamically Add new Input-Fields

Open
#1,478 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Hello!

I built an editor for landing pages based on editor.js
At some points/content blocks, i have the need for a dynamic number of input fields. For example an image slider. Every time, when a slide's content is defined properly, new form elements for a new slide is appearing.

The downside of this is, that the event system does not know of the new elements. So the edited data will get lost when saving the current page. The editor has to reinitialize the events on that tool / adding the new events to the new form elements.
My question: Can it be easily achieved, after adding new form elements to an existing block, that the handlers on this tool can be refreshed?
(When I saw this correctly, there has to be some possibility to refresh the events in ModificationsObserver)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.