Skip to content

Commit 23e78f9

Browse files
committed
fix(html): move inline styles into classes to fix csp issue
1 parent 8d7eb64 commit 23e78f9

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/components/DateInput.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<!-- Calendar Button -->
55
<span
66
v-if="calendarButton"
7-
:class="{'input-group-prepend' : bootstrapStyling}"
8-
:style="{'cursor:not-allowed;' : disabled}"
7+
:class="{'input-group-prepend' : bootstrapStyling, 'calendar-btn-disabled': disabled}"
98
class="vdp-datepicker__calendar-button"
109
@click="showCalendar(true)"
1110
>

src/components/Datepicker.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252
<template v-if="isOpen">
5353
<div
5454
ref="datepicker"
55-
:class="[calendarClass, 'vdp-datepicker__calendar']"
56-
:style="calendarStyle"
55+
:class="[calendarClass, 'vdp-datepicker__calendar', isInline && 'inline']"
5756
@mousedown.prevent
5857
>
5958
<slot name="beforeCalendarHeader" />
@@ -278,11 +277,6 @@ export default {
278277
return this.language
279278
},
280279
281-
calendarStyle() {
282-
return {
283-
position: this.isInline ? 'static' : undefined,
284-
}
285-
},
286280
isOpen() {
287281
return this.currentPicker !== ''
288282
},

src/styles/style.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* {
1010
box-sizing: border-box;
1111
}
12+
13+
.calendar-btn-disabled {
14+
cursor:not-allowed;
15+
}
1216
}
1317

1418
.vdp-datepicker__calendar {
@@ -18,6 +22,10 @@
1822
width: 300px;
1923
border: 1px solid #ccc;
2024

25+
&.inline{
26+
position: static;
27+
}
28+
2129
header {
2230
display: block;
2331
line-height: 40px;

0 commit comments

Comments
 (0)