Skip to content

Commit 0a8c2b9

Browse files
authored
feat: add default size for map component (#3460)
1 parent dd40f27 commit 0a8c2b9

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎dev/map.html‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Map</title>
88
<script type="module" src="./common.js"></script>
9-
<style>
10-
vaadin-map {
11-
width: 100%;
12-
height: 400px;
13-
}
14-
</style>
159
</head>
1610
<body>
1711
<script type="module">

‎packages/map/src/vaadin-map.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ class Map extends ResizeMixin(FocusMixin(ElementMixin(ThemableMixin(PolymerEleme
6363
<style>
6464
:host {
6565
display: block;
66-
width: 100%;
66+
height: 400px;
67+
flex: 1 1 auto;
68+
align-self: stretch;
6769
overflow: hidden;
6870
}
6971

‎packages/map/test/map.test.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ describe('configuration in detached state', () => {
4444

4545
beforeEach(() => {
4646
map = document.createElement('vaadin-map');
47-
map.style.width = '100px';
48-
map.style.height = '100px';
4947
});
5048

5149
afterEach(() => {

‎packages/map/test/styles.test.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ describe('vaadin-map styles', () => {
1818
displayValue = getComputedStyle(map).display;
1919
expect(displayValue).to.equal('none');
2020
});
21+
22+
it('should have a default size', () => {
23+
const computedStyles = getComputedStyle(map);
24+
expect(parseInt(computedStyles.width)).to.be.gt(0);
25+
expect(parseInt(computedStyles.height)).to.equal(400);
26+
});
2127
});

0 commit comments

Comments
 (0)