Skip to content

Commit 7e5d14c

Browse files
showcase input field clobber issue sveltejs/svelte#1755
1 parent e57008f commit 7e5d14c

21 files changed

+5626
-2353
lines changed

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.eslintrc.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5+
plugins: ['svelte3', '@typescript-eslint'],
6+
ignorePatterns: ['*.cjs'],
7+
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8+
settings: {
9+
'svelte3/typescript': () => require('typescript')
10+
},
11+
parserOptions: {
12+
sourceType: 'module',
13+
ecmaVersion: 2020
14+
},
15+
env: {
16+
browser: true,
17+
es2017: true,
18+
node: true
19+
}
20+
};

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.DS_Store
22
node_modules
3+
/build
34
/.svelte-kit
45
/package
6+
.env
7+
.env.*
8+
!.env.example

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100
6+
}

README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
this repo is demonstrating the problems with ssr=true and fetching something that the internal vite-proxy should provide.
2-
3-
see https://github.com/sveltejs/kit/issues/1729
1+
this repo is demonstrating the problem where hydration of the page resets input fields
42

3+
see https://github.com/sveltejs/svelte/issues/1755
54

65
to test:
7-
8-
- run a small http-server on port 8000, e.g.: `/usr/bin/env python3 -m http.server`
9-
- then run `npm run dev`
10-
11-
12-
there are 4 routes, basically the same, only varying in `ssr=false/true` and `load({fetch}) / load(), js-fetch`:
13-
14-
- http://localhost:3000/ssr_false
15-
- http://localhost:3000/ssr_false_js_fetch
16-
- http://localhost:3000/ssr_true
17-
- http://localhost:3000/ssr_true_js_fetch
18-
19-
20-
ssr_true should show the problem
6+
- run `npm run dev`
7+
- open new tab
8+
- set web browser "Throttling" to Fast 3G
9+
- navigate to http://localhost:5173/
10+
- as soon as possible enter something in the input field
11+
- after input you can disable throttling again
12+
- > the input field will be reset
13+
14+
it is also reproducable with `npm run build && npm run preview`. however I had to set it to "slow 3g" to be fast enough to catch it in that case.

api/index.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)