Merge remote-tracking branch 'upstream/master'

pull/4886/head
pushkine 5 years ago
commit 71571b0b1f

@ -2,6 +2,7 @@
## Unreleased ## Unreleased
* Update `<select>` with `bind:value` when the available `<option>`s change ([#1764](https://github.com/sveltejs/svelte/issues/1764))
* Fix inconsistencies when setting a two-way bound `<input>` to `undefined` ([#3569](https://github.com/sveltejs/svelte/issues/3569)) * Fix inconsistencies when setting a two-way bound `<input>` to `undefined` ([#3569](https://github.com/sveltejs/svelte/issues/3569))
* Fix resize listening on certain older browsers ([#4752](https://github.com/sveltejs/svelte/issues/4752)) * Fix resize listening on certain older browsers ([#4752](https://github.com/sveltejs/svelte/issues/4752))
* Add `a11y-no-onchange` warning ([#4788](https://github.com/sveltejs/svelte/pull/4788)) * Add `a11y-no-onchange` warning ([#4788](https://github.com/sveltejs/svelte/pull/4788))

@ -77,6 +77,9 @@ npm install && npm run update
npm run dev npm run dev
``` ```
### Is svelte.dev down?
Probably not, but it's possible. If you can't seem to access any `.dev` sites, check out [this SuperUser question and answer](https://superuser.com/q/1413402).
## License ## License

@ -121,6 +121,9 @@ An element or component can have multiple spread attributes, interspersed with r
<input {...$$restProps}> <input {...$$restProps}>
``` ```
> The `value` attribute of an `input` element or its children `option` elements must not be set with spread attributes when using `bind:group` or `bind:checked`. Svelte needs to be able to see the element's `value` directly in the markup in these cases so that it can link it to the bound variable.
--- ---
### Text expressions ### Text expressions

@ -521,7 +521,7 @@ $: $size = big ? 100 : 10;
### `svelte/transition` ### `svelte/transition`
The `svelte/transition` module exports six functions: `fade`, `fly`, `slide`, `scale`, `draw` and `crossfade`. They are for use with Svelte [`transitions`](docs#transition_fn). The `svelte/transition` module exports seven functions: `fade`, `blur`, `fly`, `slide`, `scale`, `draw` and `crossfade`. They are for use with Svelte [`transitions`](docs#transition_fn).
#### `fade` #### `fade`

@ -1,5 +0,0 @@
---
question: Is svelte.dev down?
---
Probably not, but it's possible. If you can't seem to access any `.dev` sites, check out [this SuperUser question and answer](https://superuser.com/q/1413402).

@ -87,7 +87,7 @@ export default class BindingWrapper {
const update_conditions: any[] = this.needs_lock ? [x`!${lock}`] : []; const update_conditions: any[] = this.needs_lock ? [x`!${lock}`] : [];
const mount_conditions: any[] = []; const mount_conditions: any[] = [];
const dependency_array = [...this.node.expression.dependencies]; const dependency_array = Array.from(this.get_dependencies());
if (dependency_array.length > 0) { if (dependency_array.length > 0) {
update_conditions.push(block.renderer.dirty(dependency_array)); update_conditions.push(block.renderer.dirty(dependency_array));

@ -0,0 +1,34 @@
export default {
props: {
items: [],
selected: 'two'
},
html: `
<select></select>
<p>selected: two</p>
`,
ssrHtml: `
<select value="two"></select>
<p>selected: two</p>
`,
test({ assert, component, target }) {
component.items = [ 'one', 'two', 'three' ];
const options = target.querySelectorAll('option');
assert.ok(!options[0].selected);
assert.ok(options[1].selected);
assert.ok(!options[2].selected);
assert.htmlEqual(target.innerHTML, `
<select>
<option value='one'>one</option>
<option value='two'>two</option>
<option value='three'>three</option>
</select>
<p>selected: two</p>
`);
}
};

@ -0,0 +1,12 @@
<script>
export let selected;
export let items;
</script>
<select bind:value={selected}>
{#each items as item}
<option>{item}</option>
{/each}
</select>
<p>selected: {selected || 'nothing'}</p>
Loading…
Cancel
Save