Skip to content

Commit 3d8e9cd

Browse files
committed
simplify
1 parent 3a2426b commit 3d8e9cd

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,11 @@ export const template_visitors = {
21752175
);
21762176

21772177
if (has_direction_attribute) {
2178-
context.state.update.push(b.stmt(b.call('$.set_direction', node_id)));
2178+
// This fixes an issue with Chromium where updates to text content within an element
2179+
// does not update the direction when set to auto. If we just re-assign the dir, this fixes it.
2180+
context.state.update.push(
2181+
b.stmt(b.assignment('=', b.member(node_id, b.id('dir')), b.member(node_id, b.id('dir'))))
2182+
);
21792183
}
21802184

21812185
if (child_locations.length > 0) {

packages/svelte/src/internal/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export {
118118
update_pre_store,
119119
update_store
120120
} from './reactivity/store.js';
121-
export { append_styles, sanitize_slots, set_text, set_direction, slot } from './render.js';
121+
export { append_styles, sanitize_slots, set_text, slot } from './render.js';
122122
export {
123123
get,
124124
invalidate_inner_signals,

packages/svelte/src/internal/client/render.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ export function set_text(text, value) {
5050
}
5151
}
5252

53-
/**
54-
* @param {HTMLElement} element
55-
*/
56-
export function set_direction(element) {
57-
// This fixes an issue with Chromium where updates to text content within an element
58-
// does not update the direction when set to auto. If we just re-assign the dir, this fixes it.
59-
// eslint-disable-next-line no-self-assign
60-
element.dir = element.dir;
61-
}
62-
6353
/**
6454
* @param {Comment} anchor
6555
* @param {void | ((anchor: Comment, slot_props: Record<string, unknown>) => void)} slot_fn

0 commit comments

Comments
 (0)