-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rtl): prevent horizontal scrollbar on RTL (#468)
Fixes #466 - Add workaround to prevent horizontal scrollbar appearing when charts is in RTL. - Add test to check if the scrollWidth is affected by RTL
- Loading branch information
1 parent
a9bfd10
commit 8334485
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!doctype html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>vaadin-chart tests</title> | ||
<script src="../../web-component-tester/browser.js"></script> | ||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../test-fixture/test-fixture.html"> | ||
<link rel="import" href="../../vaadin-ordered-layout/vaadin-horizontal-layout.html"> | ||
<link rel="import" href="../vaadin-chart.html"> | ||
</head> | ||
|
||
<body> | ||
<test-fixture id="default"> | ||
<template> | ||
<vaadin-chart> | ||
<vaadin-chart-series values="[1,7,3,1,5,6]"></vaadin-chart-series> | ||
</vaadin-chart> | ||
</template> | ||
</test-fixture> | ||
<script> | ||
describe('Chart In RTL', function() { | ||
|
||
before(function(done) { | ||
fixture('default'); | ||
|
||
requestAnimationFrame(() => { | ||
done(); | ||
}); | ||
}); | ||
|
||
it('chart should not create horizontal scroll on RTL', function() { | ||
const scrollWidthBeforeRTL = document.documentElement.scrollWidth; | ||
document.dir = 'rtl'; | ||
|
||
expect(scrollWidthBeforeRTL).to.be.equal(document.documentElement.scrollWidth); | ||
}); | ||
}); | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters