From 5e1d96a533d18333f359f9005054664416457e11 Mon Sep 17 00:00:00 2001 From: Cory Reed Date: Mon, 5 Mar 2018 20:48:50 -0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(demos):=20correct=20RTL=20=E2=86=94=20L?= =?UTF-8?q?TR=20top=20app=20bar=20toggling=20in=20Safari?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This addresses a bug in Safari 11 where removing the `dir=rtl` attribute on the `body` element does not revert the direction change on many child elements. Explicitly settint the `dir` back to `ltr` corrects this behavior. --- demos/top-app-bar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/top-app-bar.html b/demos/top-app-bar.html index d0ca4ba2dfe..159d11dea23 100644 --- a/demos/top-app-bar.html +++ b/demos/top-app-bar.html @@ -199,7 +199,7 @@

Demo Controls

}); rtlCheckbox.addEventListener('change', function() { - document.body[this.checked ? 'setAttribute' : 'removeAttribute']("dir", "rtl"); + document.body.setAttribute('dir', this.checked ? 'rtl': 'ltr'); appBarEl.classList.remove('mdc-top-app-bar--short-has-action-item'); appBar.destroy(); From 32d6283e21ecb4f09c1271f49b6d515540f8b5e3 Mon Sep 17 00:00:00 2001 From: Cory Reed Date: Mon, 5 Mar 2018 22:17:03 -0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(demos):=20correct=20RTL=20=E2=86=94=20L?= =?UTF-8?q?TR=20toggling=20in=20card=20demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demos/card.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/demos/card.html b/demos/card.html index f4160fa5bf1..86eb4c7e9da 100644 --- a/demos/card.html +++ b/demos/card.html @@ -238,11 +238,7 @@

Asia's clean energ var rtlToggle = document.getElementById('toggle-rtl'); rtlToggle.addEventListener('change', function() { var docEl = document.documentElement; - if (rtlToggle.checked) { - docEl.setAttribute('dir', 'rtl'); - } else { - docEl.removeAttribute('dir'); - } + docEl.setAttribute('dir', rtlToggle.checked ? 'rtl' : 'ltr'); }); [].forEach.call(document.querySelectorAll('.mdc-button'), function(surface) {