Closed codenoid closed 2 months ago
@777Naity you are sharing a Malware using GitHub issue report?
Hello @codenoid
The <uk-select>
is a web component and I have only a very limited support for reactive frameworks. Yes, it supposed to be hidden because web component will remove the uk-cloak
attribute by itself once it's ready.
You can import the webc cdn on your app.html
or if you're using npm, check if svelte is running on browser then do the import.
thanks for the response @sveltecult , I have import webc on my Svelte app.html with
<script type="module" src="/js/franken-wc@0.0.6/wc.iife.js"></script>
but the component is still not exist, and not just that, the content inside uk-select is removed
Yes, CDN does not seem to work on app.html
but it worked when I import it from NPM. Here's my code for reference:
<script>
import { browser } from '$app/environment';
if (browser) {
import('uikit');
import('franken-wc');
}
</script>
<div class="uk-container uk-margin-large-top uk-margin-large-bottom">
<uk-select name="test" uk-cloak>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
<option value="option4">Option 4</option>
<option value="option5">Option 5</option>
</uk-select>
</div>
Output:
Be cautious though. You will encounter issues like this when HMR is triggered, you can try full refresh.
Also, I'm not sure if loops {#each}
will work inside <uk-select>
and last time I tested, options are not reactive if you dynamically add <option>
tag.
Unfortunately, I have no plans to support reactive frameworks as I'm this framework prioritize HTML (server rendered pages). However, you can use the native select
tag or find a svelte-native components like headless-svelte and design it up your own.
Also, I'm not sure if loops {#each} will work inside
and last time I tested, options are not reactive if you dynamically add
I see, I might need to server-rendered the page
anyway thanks, the code is now working
@sveltecult I am one of those folks dynamically adding inner
Actually, where I go to see the source code for the uk-select
web component?
the select element is hidden
after I try to uncheck the uk-cloak attribute, it rendered like this:
code:
I'm on
"franken-ui": "^0.2.0"
Tailwind config:
Postcss config: