Skip to main content

All Questions

0 votes
1 answer
28 views

Parameters in svelte action not reactive

Svelte action that does things when keys are pressed: import type { Action } from "svelte/action" export const keys: Action<HTMLElement, boolean> = (node, active?: boolean) => { ...
Alex's user avatar
  • 66.3k
0 votes
1 answer
47 views

Export function from Svelte component

Component.svelte: <script> export function test(){ return "test"; } </script> App.svelte: <script> import { test } from "./Component.svelte" // error; ...
Alex's user avatar
  • 66.3k
0 votes
2 answers
122 views

Svelte child component props doesn't update on parent state change

Parent component: <script> import Child from "./Child.svelte" import { onMount } from "svelte"; import apireq from "./api.js"; let items = $...
Alex's user avatar
  • 66.3k
1 vote
2 answers
506 views

Other than children(), can I import and render multiple snippets in +layout.svelte that are defined in +page.svelte?

New to SvelteKit and trying to figure this part out... Here's a couple of ways I was trying to achieve this, but the sidebar either doesn't load, or the navigation appears twice for some reason; with ...
Brad T's user avatar
  • 35
0 votes
0 answers
127 views

How to add a submenu to my dropdown in svelte

I'm working on a svelte project where I have a top bar with a few menus. When I hover over the menus a dropdown will appear below with some menu items. Some menu items have subitems that I want to ...
user24917036's user avatar
0 votes
1 answer
141 views

Save data submitted from a Form into a Store in Sveltekit

So I've got the following component working so far records/new/+page.svelte: <script> import RecordForm from "../../../components/forms/RecordForm.svelte"; import TrackForm ...
MrCujo's user avatar
  • 1,333
0 votes
1 answer
85 views

How does the parent component re-execute a function after a Svelte child component changes?

I have a svelte code.I want to implement a function that the parent component re-executes after the child component is updated. I am facing a problem now.After the child component is updated, the ...
cnfj's user avatar
  • 39
-1 votes
2 answers
142 views

Binding two number inputs to variables so one input is always bigger than or equal to other

I want to have two inputs: Input A initialy containing a prop named "min" showing the maximum number possible in inputs Input B initialy containing a prop named "max" showing the ...
Magical Briefcase's user avatar
0 votes
1 answer
365 views

on:click event not firing from within @error.svelte

I have a SvelteKit app with an @error.svelte page at the root of the /routes folder. Inside of this page, I have two buttons. One is in the header and the other one trigger's a page event when clicked ...
user2030942's user avatar
0 votes
1 answer
74 views

Svelte Checkbox input state does not match to html checkbox state

I am having problems with my custom checkbox component. My goal is for the parant to have control over the selected state of the input. But every time I click the checkbox it gets selected even if ...
Samuel Knoch's user avatar
  • 1,215
0 votes
1 answer
56 views

I have a question about the svelte radio component

Radio components are being made and used. However, the input tag cannot be found because the parent page onMount runs earlier than the logic in the component. Is there any way to disable onMount on ...
car's user avatar
  • 3
0 votes
1 answer
283 views

svelte create and pass component as html element

I'm using a library which requires me to create an html element and pass that element. Then the library puts the element in the correct place internally. The problem I'm facing is that the element i ...
Anton's user avatar
  • 781
0 votes
0 answers
446 views

Svelte Component Errors: Cannot read properties of null (reading 'current'), TypeError: unsubscribe is not a function

I have a component that accesses a svelte store writable but the component just gets rendered before the data arrives into the store variable. This are the errors enter image description here I want ...
Nico's user avatar
  • 21
1 vote
1 answer
1k views

How is component inheritance done in Svelte?

I currently have a Modal.svelte component that uses native , I would like to create another component called ModalSheet.svelte whose parent is Modal.svelte. Is this possible in Svelte without ...
RichardMiracles's user avatar
0 votes
0 answers
128 views

Svelte component not forwarding an event

I have a series of 3 Svelte components, one inside the other, and am trying to forward an event from the innermost to the outermost component. However, the event is only triggered on the second, ...
awj's user avatar
  • 7,979

15 30 50 per page
1
2 3 4 5
12