Skip to content

Commit

Permalink
Fix RTL observer not working
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Aug 10, 2024
1 parent 78ca5bb commit ff29e93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/is-rtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ let IS_RTL = false;
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes') {
const { value } = mutation.target;
if (value === 'rtl') {
const { dir } = mutation.target;
if (dir === 'rtl') {
IS_RTL = true;
} else {
IS_RTL = false;
}
console.log({ IS_RTL });
// Fire custom event 'dirchange' on document
// document.dispatchEvent(new Event('dirchange'));
}
Expand Down

0 comments on commit ff29e93

Please sign in to comment.