-
-
Notifications
You must be signed in to change notification settings - Fork 106
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 option element in select field. #13
Comments
I tried installing the forms plugin standalone in hopes to make it work, as the code required for the traits is in that package, but it didn't work no matter how I tested it. I had to copy this code
And put it after my editor instance in order for the options to appear now and to be able to change them. Before doing this, when changing it, it had a weird effect, it put a No idea why in the preset plugin it would work when you install it, maybe because of the way it loads things? I didn't want to install it because I am trying to only install the packages I use. A quick note, are you able to click on the select to see the dropdown options in preview mode? I am not able to see them at all except of I look at the code. Thanks for your help! |
Let me look into this code, I will try to integrate it so that this package doesn't have to rely on the Regarding the click event in the select, this is not working, I did notice this before but didn't look into it because the main GrapesJS demo doesn't do this either. Maybe I can get this to work somehow. |
Alright, so I integrated the code into the plugin, additionally you can pass the optionsStringSeparator in the config if you want to use another separator instead of the '::' Default separator:
Custom separator:
|
Awesome, thanks a bunch, I will test it out. But it works for now which is great! |
Yeah, I also thought that, maybe I can try to do something about the select's options in the traits. |
Hi Miguel,
Stupid question, how do you add option elements in the select field of the forms?
I looked and I noticed that it seems to use the same traits as the forms package from grapesjs plugin, but I still don't get it.
I noticed that when dropping the select element it adds a default option.
Like this, but when I click on the select element in the canvas, I don't see the options appear in the options trait.
Thanks!
The text was updated successfully, but these errors were encountered: