Skip to content

Commit 3f978c6

Browse files
authored
Merge pull request #464 from melissayr/melissayr-patch-1
Update select.html from "var" to "const"
2 parents c92fb1c + 3bdf5d2 commit 3f978c6

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"homepage": "https://materializeweb.com",
66
"version": "2.0.3",
77
"main": "dist/js/materialize.js",
8-
"module": "src/index.ts",
98
"style": "dist/css/materialize.css",
109
"sass": "sass/materialize.scss",
1110
"typings": "dist/src/index.d.ts",

src/tabs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ export class Tabs extends Component<TabsOptions> {
207207
this._index = Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink), 0);
208208
if (this._activeTabLink && this._activeTabLink.hash) {
209209
this._content = document.querySelector(this._activeTabLink.hash);
210-
this._content.classList.add('active');
210+
if (this._content)
211+
this._content.classList.add('active');
211212
}
212213
}
213214

test/html/select.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ <h5>Dynamically generated Select-Options <button class="btn3">Create + Init Sele
154154

155155
<script type="text/javascript">
156156
document.addEventListener('DOMContentLoaded', function() {
157-
var elems = document.querySelectorAll('select');
157+
const elems = document.querySelectorAll('select');
158158

159159
elems[0].addEventListener('change', e => console.log("First Select changed!"));
160160
elems[1].addEventListener('change', e => console.log("Second Select changed!"));
161161

162-
var instances = M.FormSelect.init(elems, {
162+
const instances = M.FormSelect.init(elems, {
163163
// specify options here
164164
});
165165
// Methods

0 commit comments

Comments
 (0)