diff --git a/.changeset/afraid-carrots-study.md b/.changeset/afraid-carrots-study.md
new file mode 100644
index 000000000000..71f4232edb85
--- /dev/null
+++ b/.changeset/afraid-carrots-study.md
@@ -0,0 +1,5 @@
+---
+'svelte': patch
+---
+
+fix: reset attribute cache after setting corresponding property
diff --git a/packages/svelte/src/internal/client/dom/elements/attributes.js b/packages/svelte/src/internal/client/dom/elements/attributes.js
index 22e532f5e44a..2fa5d4541c48 100644
--- a/packages/svelte/src/internal/client/dom/elements/attributes.js
+++ b/packages/svelte/src/internal/client/dom/elements/attributes.js
@@ -19,7 +19,7 @@ import { attach } from './attachments.js';
import { clsx } from '../../../shared/attributes.js';
import { set_class } from './class.js';
import { set_style } from './style.js';
-import { ATTACHMENT_KEY, NAMESPACE_HTML } from '../../../../constants.js';
+import { ATTACHMENT_KEY, NAMESPACE_HTML, UNINITIALIZED } from '../../../../constants.js';
import { block, branch, destroy_effect, effect } from '../../reactivity/effects.js';
import { init_select, select_option } from './bindings/select.js';
import { flatten } from '../../reactivity/async.js';
@@ -446,6 +446,8 @@ export function set_attributes(element, prev, next, css_hash, skip_warning = fal
) {
// @ts-ignore
element[name] = value;
+ // remove it from attributes's cache
+ if (name in attributes) attributes[name] = UNINITIALIZED;
} else if (typeof value !== 'function') {
set_attribute(element, name, value, skip_warning);
}
diff --git a/packages/svelte/tests/runtime-legacy/samples/attribute-after-property/_config.js b/packages/svelte/tests/runtime-legacy/samples/attribute-after-property/_config.js
new file mode 100644
index 000000000000..f6a98b1797c7
--- /dev/null
+++ b/packages/svelte/tests/runtime-legacy/samples/attribute-after-property/_config.js
@@ -0,0 +1,19 @@
+import { flushSync } from 'svelte';
+import { test } from '../../test';
+
+export default test({
+ test({ target, assert }) {
+ const input = target.querySelector('input');
+ const button = target.querySelector('button');
+
+ assert.equal(input?.step, 'any');
+
+ button?.click();
+ flushSync();
+ assert.equal(input?.step, '10');
+
+ button?.click();
+ flushSync();
+ assert.equal(input?.step, 'any');
+ }
+});
diff --git a/packages/svelte/tests/runtime-legacy/samples/attribute-after-property/main.svelte b/packages/svelte/tests/runtime-legacy/samples/attribute-after-property/main.svelte
new file mode 100644
index 000000000000..2921e4e24182
--- /dev/null
+++ b/packages/svelte/tests/runtime-legacy/samples/attribute-after-property/main.svelte
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file