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

svelte app: target node with class not special tag #457

Open
ksuess opened this issue Nov 13, 2020 · 4 comments
Open

svelte app: target node with class not special tag #457

ksuess opened this issue Nov 13, 2020 · 4 comments

Comments

@ksuess
Copy link
Member

ksuess commented Nov 13, 2020

Change 'svelte_src/expertsearch-plus/src/main.js':

let targets = document.getElementsByClassName("expertsearch-plus");

Change src/greenthumb/expertsearchplus/svelte_apps/my-svelte-app/index.html:

<div class="expertsearch-plus"></div>
@ksuess ksuess changed the title svelte app: target node maybe with id not special tag? svelte app: target node with class not special tag Apr 30, 2021
@MrTango
Copy link
Contributor

MrTango commented Jun 3, 2021

Do you have a specific reason why you prefer this?
At this point depending what you choose for the svelte_app_custom_element question, you will have a custom element, which usually works by adding a special tag or you will have a more traditional JS component, where we would have a different way.
Right now it is the same tag for both variants. But it's not hard to change it if you prefer it for your project.
Of course it would be possible to integrate this option in the template, so that you can choose it with a question. But i don't have the plan and the urge to work on that right now.

@ksuess
Copy link
Member Author

ksuess commented Jun 4, 2021

A custom tag gets stripped off when inserting in source code of rich text field in Plone unless you explicitly allow it. It would be easier for someone to try Svelte in Plone if he is not bothered with this necessary step to set up Plone.

@MrTango
Copy link
Contributor

MrTango commented Jun 4, 2021

I know, but the bobtemplate adds the tag to the allowed tags, so it should work without any changes.
I usually test this kind of things in a Zope Page Template added via ZMI.
But only for complex tags where i also need to add properties to the tag.

@MrTango
Copy link
Contributor

MrTango commented Jun 4, 2021

As i said, we could add a question like this:
Use a custom tag to initalize the component? Otherwise we use a CSS class. [Y]
This question we should only ask if the user choose svelte native component, but not when she choose custom element.
I'm happy to review a PR.

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

No branches or pull requests

2 participants