Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add text input to right area #331

Open
xxl4 opened this issue Dec 5, 2023 · 2 comments
Open

how to add text input to right area #331

xxl4 opened this issue Dec 5, 2023 · 2 comments

Comments

@xxl4
Copy link

xxl4 commented Dec 5, 2023

Hello Everyone!

Today, i want to add the input on the right area ,like it.

image

how can i start ? Thank you.

@xxl4 xxl4 changed the title how to add text input to left area how to add text input to right area Dec 5, 2023
@givanz
Copy link
Owner

givanz commented Jan 22, 2024

Hi

You can check the preformatted component that has a textarea input to edit the content of the selected element
https://github.com/givanz/VvvebJs/blob/master/libs/builder/components-html.js#L913-L914
it uses the innerHTML attribute.

You can add the same text property from preformatted component to the base component https://github.com/givanz/VvvebJs/blob/master/libs/builder/components-common.js#L75-L101 to make it available for all components.

The only thing missing is a CodeEditorInput or RichTextEditorInput to use instead of TextareaInput.

For this you can duplicate the TextareaInput code in https://github.com/givanz/VvvebJs/blob/master/libs/builder/inputs.js#L72-L86 and https://github.com/givanz/VvvebJs/blob/master/editor.html#L848-L854

CodeMirror library is already included and used for code editor and the code can be adapted for the input https://github.com/givanz/VvvebJs/blob/master/libs/builder/plugin-codemirror.js#L12

@xxl4
Copy link
Author

xxl4 commented Jan 23, 2024

Hi

You can check the preformatted component that has a textarea input to edit the content of the selected element https://github.com/givanz/VvvebJs/blob/master/libs/builder/components-html.js#L913-L914 it uses the innerHTML attribute.

You can add the same text property from preformatted component to the base component https://github.com/givanz/VvvebJs/blob/master/libs/builder/components-common.js#L75-L101 to make it available for all components.

The only thing missing is a CodeEditorInput or RichTextEditorInput to use instead of TextareaInput.

For this you can duplicate the TextareaInput code in https://github.com/givanz/VvvebJs/blob/master/libs/builder/inputs.js#L72-L86 and https://github.com/givanz/VvvebJs/blob/master/editor.html#L848-L854

CodeMirror library is already included and used for code editor and the code can be adapted for the input https://github.com/givanz/VvvebJs/blob/master/libs/builder/plugin-codemirror.js#L12

Thank you for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants