Skip to content

Commit

Permalink
Merge pull request #3 from iansan5653/fix-rtl
Browse files Browse the repository at this point in the history
Fix RTL/alternative directions support
  • Loading branch information
iansan5653 authored May 10, 2024
2 parents 9c96031 + 4d307ad commit 179c0e3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/input-style-clone-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export class InputStyleCloneElement extends CustomHTMLElement {
this.#updateText();

this.#styleObserver.observe(input, {
attributeFilter: ["style"],
attributeFilter: [
"style",
"dir", // users can right-click in some browsers to change the text direction dynamically
],
});
this.#resizeObserver.observe(input);

Expand Down Expand Up @@ -241,7 +244,12 @@ export class InputStyleCloneElement extends CustomHTMLElement {
// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),
// so we have to list every single property explicitly.
const propertiesToCopy = [
"direction", // RTL support
// RTL / vertical writing modes support:
"direction",
"writingMode",
"unicodeBidi",
"textOrientation",

"boxSizing",

"borderTopWidth",
Expand Down

0 comments on commit 179c0e3

Please sign in to comment.