Skip to main content

All Questions

Tagged with
0 votes
1 answer
63 views

css gets transitioned at first mount

I have a svelte app that mounts some progress dots into a pretty plain html site. simplified the ProgressDots.svelte has this: hello <div class="progress-dots"> <div class="...
munHunger's user avatar
  • 3,061
-3 votes
1 answer
35 views

Svelte multiple small components vs regular html elements

Does it affect performance having svelte components instead of regular HTML elements, for small things like buttons, links etc? Wrapping these elements in a svelte component would make it more ...
Alex's user avatar
  • 66.3k
0 votes
1 answer
47 views

How to Sync Scrolling between 2 containers while displaying panel on hover

In my svelte component, I'm displaying line numbers for each line in text area. I've disabled the scrolling of line number. And manually sync line number container when I scroll on text area. overflow-...
Amit Kumar Gupta's user avatar
0 votes
1 answer
64 views

How to get a component's children height?

I'm trying to create a component that will render it's children when it comes into the viewport, here's the code: <script lang="ts"> import type { Snippet } from 'svelte'; ...
Christopher Poulsen's user avatar
1 vote
1 answer
69 views

Svelte Responsive Menu does not show vertical items on narrow screen

I can't get this W3C Responsive Menu to work in Svelte. The menu horizontal navbar is correctly hidden, but I cannot get the vertical version to show. The demo on the W3C site works. When I build it ...
Chris's user avatar
  • 1,475
2 votes
1 answer
112 views

"Uncaught (in promise) TypeError: ...img is undefined" when using @sveltejs/enhanced-img with dynamic image URLs

I'm encountering an issue using @sveltejs/enhanced-img in my Svelte project. I've installed it via npm install --save-dev @sveltejs/enhanced-img and configured it in vite.config.js. My setup involves ...
Leonardo Cavalcante's user avatar
0 votes
1 answer
91 views

Serving .js and .css from Vite + Svelte to a static website

I have a pre-existing website using a popular website builder. I want to be able to inject interactive svelte components on certain blog pages to help demonstrate concepts. I got a rough prototype ...
learyjk's user avatar
  • 731
2 votes
1 answer
185 views

Svelte 5: Form briefly appears then disappears on page load when using conditional rendering for an image

I'm encountering a strange issue with a Svelte 5 component where a form briefly flashes on the screen for about half a second when the page loads, and then disappears. This happens when I have ...
Leonardo Cavalcante's user avatar
0 votes
2 answers
200 views

SvelteKit - Redirect after Form Submit

I have a problem with redirecting after submitting form in SvelteKit. I have some routes that needs authentication, before rendering it I'm checking if user is authenticated. routes │   ├── +page....
rh3h's user avatar
  • 1
1 vote
1 answer
43 views

svelte page/component caching issue with shared navbar component

I am developing a website currently, and have run into a small problem. === Steps to reproduce: 1.npm create svelte@latest test (skeleton, typescript, eslint-prettier-playwright-vitest) 2.cd test 3....
coding_noob's user avatar
0 votes
1 answer
121 views

Svelte styles are not applied to scope

I have a problem with adding styles in my Svelte components. I want to make sure that my styles are only applied within a specific component, but it doesn't work. Here is an example of a component. ...
sampa's user avatar
  • 639
0 votes
0 answers
59 views

Host Static SPA written in HTML/JS in WebView2

I have created a Static SPA using SvelteKit, and i want to open the application in Revit using WebView2. The compiled file structure of my application looks like this: build - index.html - favicon.png ...
Ólavur Nón's user avatar
0 votes
1 answer
43 views

Why is a comma (,) being added to the questionIndex when I am using it again for the following svelte component?

I have two components, Question.svelte and QuestionList.svelte. The Question component has a clear button which will clear the selection of its options, which are radio buttons. The QuestionList ...
CrazyUser4232434's user avatar
-1 votes
1 answer
29 views

Is there a way to submit a form with multiple copies of the same fields (or component) in an organized way? [duplicate]

I've got the following component: <script> export let componentID; console.log("component iD", componentID) </script> <div> <div class="grid grid-cols-...
MrCujo's user avatar
  • 1,333
0 votes
1 answer
69 views

Is it possible to limit results from Svelte {#each} loop by a certain amount?

I'm using an {#each} loop to showcase data, but I'm curious if Svelte has a way to limit the results by an integer. For example, if I had the following array and loop: const object = [1, 2, 3, 4, 5]; ...
Sam Sabin's user avatar
  • 1,173

15 30 50 per page
1
2 3 4 5
14