pull/12204/head
Dominic Gannaway 2 years ago
parent 3a2426b12d
commit 3d8e9cd3eb

@ -2175,7 +2175,11 @@ export const template_visitors = {
);
if (has_direction_attribute) {
context.state.update.push(b.stmt(b.call('$.set_direction', node_id)));
// This fixes an issue with Chromium where updates to text content within an element
// does not update the direction when set to auto. If we just re-assign the dir, this fixes it.
context.state.update.push(
b.stmt(b.assignment('=', b.member(node_id, b.id('dir')), b.member(node_id, b.id('dir'))))
);
}
if (child_locations.length > 0) {

@ -118,7 +118,7 @@ export {
update_pre_store,
update_store
} from './reactivity/store.js';
export { append_styles, sanitize_slots, set_text, set_direction, slot } from './render.js';
export { append_styles, sanitize_slots, set_text, slot } from './render.js';
export {
get,
invalidate_inner_signals,

@ -50,16 +50,6 @@ export function set_text(text, value) {
}
}
/**
* @param {HTMLElement} element
*/
export function set_direction(element) {
// This fixes an issue with Chromium where updates to text content within an element
// does not update the direction when set to auto. If we just re-assign the dir, this fixes it.
// eslint-disable-next-line no-self-assign
element.dir = element.dir;
}
/**
* @param {Comment} anchor
* @param {void | ((anchor: Comment, slot_props: Record<string, unknown>) => void)} slot_fn

Loading…
Cancel
Save