Skip to main content

All Questions

Tagged with
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
88 views

Get submitted button's name in Sveltekit actions

I've got a form with 2 buttons: <form method="POST" class="pt-10"> <div class="flex flex-row pt-10"> <button type="submit" name="...
MrCujo's user avatar
  • 1,333
0 votes
0 answers
47 views

Unable to use firebase in svelte

I am trying to add some code to previous github repo but while using firebase after creating a page in src/routes folder I am unable to use it. Do I have to use firebase compat? As that also didn't ...
user26268062's user avatar
0 votes
1 answer
215 views

Sveltekit reuse form as a modal within another form

I've got the following route: - routes - artists - [slug] - new - +page.server.js - +page.svelte where new/+page.svelte is the following: <script> import ...
MrCujo's user avatar
  • 1,333
0 votes
1 answer
515 views

Redirect using server hooks not working in SvelteKit

I am creating an application in sveltekit, trying to protect my routes through the use of hooks or middleware, but when I am logged in and try to enter an unprotected route, I want to redirect to the /...
Jose Martin Castro Agüero's user avatar
0 votes
1 answer
57 views

Why <slot item={child} /> is needed for the nested object to be displayed if <slot item={item} /> is present?

This question is in reference to Pass in a slot to a recursive component REPL App.svelte <script> import Tree from './Tree.svelte'; const items = [ { type: 'person', ...
poyango's user avatar
  • 13
0 votes
1 answer
442 views

Svelte change bind:value in keydown event

I want to add spaces in a card ID input field automatically as the user is typing it. Here is my setup: <input placeholder="e.g. 5200 1234 5678 9012 3456" bind:value={inputAC} ...
Hykilpikonna's user avatar
  • 2,171
0 votes
1 answer
332 views

Why won't my Svelte dropdown close when the dropdown is open, but I click on the Dropdown Box?

What Works Hi, I have an issue with my custom HTML dropdown made in Svelte. I'm a React engineer and new to svelte due to this company code that this small portion was written in just because previous ...
jefelewis's user avatar
  • 2,059
0 votes
1 answer
236 views

Accessing not defined property on svelte component should raise TypeScript type error

When using Svelte with TypeScript, I expected that accessing a property on a component that has not been defined to result in a type error. It results in the property being typed as any instead. I ...
RigoTamas's user avatar
1 vote
1 answer
144 views

Svelte3: A modal at docroot with dynamic content

I am trying to implement a modal dialog box somewhat typical, but with a few prerequisites that I don't see how to implement the svelte way: It needs to sit at docroot (and be free of parents ...
Thony's user avatar
  • 2,402
0 votes
1 answer
34 views

targeting a specific element in iteration using js and svelte

I love and use svelte in everything but this a new issue that I've never encountered before and I'm unable to figure a solution. I'm using svelte to iterate over an array : <section> <h5&...
Marco's user avatar
  • 1,205
1 vote
0 answers
153 views

Jest encountered an unexpected token during upgrade Svelte v3 to v4

I'm stucked during the upgrade of svelte v3 to v4 using the official guide. My tests are failing and I've tried multiple ways to fix it but nothing worked here for me. Here some details about my ...
imalik8088's user avatar
  • 1,651
2 votes
1 answer
63 views

How to disambiguate svelte components?

I have the following typescript type: type ItemTypes = (GameItem & { id: undefined }) | (CurrencyItem & { id: string }); The GameItem is an object that doesn't have the "id" ...
Javier Villanueva's user avatar
0 votes
2 answers
2k views

Sveltekit: display alert message after redirecting

I'm working on a project using Sveltekit for the frontend. To display on screen alert messages I had created the following. In +layout.svelte (the main layout file) I have: <!-- Main content --> ...
MrCujo's user avatar
  • 1,333
0 votes
1 answer
192 views

Tweened component prop

I have this CircularProgressBar.svelte component and I want to animate when the percentage changes. This is how CircularProgressBar.svelte is defined: <script> import { onMount } from "...
R1D3R175's user avatar
  • 190

15 30 50 per page
1
2 3 4 5
41