Skip to content

Commit 62192a3

Browse files
committed
chore: release 2.1.0
1 parent 90acdf6 commit 62192a3

7 files changed

Lines changed: 669 additions & 575 deletions

File tree

dist/css/materialize.css

Lines changed: 644 additions & 560 deletions
Large diffs are not rendered by default.

dist/css/materialize.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/materialize.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Materialize v2.0.4 (https://materializeweb.com)
2+
* Materialize v2.1.0 (https://materializeweb.com)
33
* Copyright 2014-2024 Materialize
44
* MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)
55
*/
@@ -3711,7 +3711,12 @@ class Modal extends component_1.Component {
37113711
this.options.onOpenStart.call(this, this.el, this._openingTrigger);
37123712
}
37133713
if (this.options.preventScrolling) {
3714-
document.body.style.overflow = 'hidden';
3714+
const hasVerticalScrollBar = document.documentElement.scrollHeight > document.documentElement.clientHeight;
3715+
if (hasVerticalScrollBar) {
3716+
const scrollTop = document.documentElement.scrollTop;
3717+
document.documentElement.style.top = '-' + scrollTop + "px";
3718+
document.documentElement.classList.add('noscroll');
3719+
}
37153720
}
37163721
this.el.classList.add('open');
37173722
this.el.insertAdjacentElement('afterend', this._overlay);
@@ -3740,7 +3745,10 @@ class Modal extends component_1.Component {
37403745
this.el.classList.remove('open');
37413746
// Enable body scrolling only if there are no more modals open.
37423747
if (Modal._modalsOpen === 0) {
3743-
document.body.style.overflow = '';
3748+
const scrollTop = -parseInt(document.documentElement.style.top);
3749+
document.documentElement.style.removeProperty("top");
3750+
document.documentElement.classList.remove('noscroll');
3751+
document.documentElement.scrollTop = scrollTop;
37443752
}
37453753
if (this.options.dismissible) {
37463754
document.removeEventListener('keydown', this._handleKeydown);
@@ -4670,11 +4678,9 @@ class FormSelect extends component_1.Component {
46704678
// Makes new element to assume HTML's select label and aria-attributes, if exists
46714679
/*
46724680
if (this.el.hasAttribute("aria-labelledby")){
4673-
console.log(1);
46744681
this.labelEl = <HTMLLabelElement>document.getElementById(this.el.getAttribute("aria-labelledby"));
46754682
}
46764683
else if (this.el.id != ""){
4677-
console.log(2);
46784684
const label = document.createElement('label');
46794685
label.setAttribute('for', this.el.id);
46804686
if (label){
@@ -6884,9 +6890,13 @@ class Toast {
68846890
}
68856891
}
68866892
_createToast() {
6887-
const toast = this.options.toastId
6893+
let toast = this.options.toastId
68886894
? document.getElementById(this.options.toastId)
68896895
: document.createElement('div');
6896+
if (toast instanceof HTMLTemplateElement) {
6897+
const node = toast.content.cloneNode(true);
6898+
toast = node.firstElementChild;
6899+
}
68906900
toast.classList.add('toast');
68916901
toast.setAttribute('role', 'alert');
68926902
toast.setAttribute('aria-live', 'assertive');
@@ -6957,7 +6967,7 @@ class Toast {
69576967
this.options.completeCallback();
69586968
}
69596969
// Remove toast from DOM
6960-
if (!this.options.toastId) {
6970+
if (this.el.id != this.options.toastId) {
69616971
this.el.remove();
69626972
Toast._toasts.splice(Toast._toasts.indexOf(this), 1);
69636973
if (Toast._toasts.length === 0) {
@@ -7658,7 +7668,7 @@ class M {
76587668
}
76597669
}
76607670
exports.M = M;
7661-
M.version = '2.0.4';
7671+
M.version = '2.1.0';
76627672
M.Autocomplete = autocomplete_1.Autocomplete;
76637673
M.Tabs = tabs_1.Tabs;
76647674
M.Carousel = carousel_1.Carousel;

dist/js/materialize.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/materialize.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "The responsive front-end library based on Material Design from Google.",
44
"author": "The Materialize Team",
55
"homepage": "https://materializeweb.com",
6-
"version": "2.0.4",
6+
"version": "2.1.0",
77
"main": "dist/js/materialize.js",
88
"style": "dist/css/materialize.css",
99
"sass": "sass/materialize.scss",

src/global.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { Range } from './range';
2626
import { Utils } from './utils';
2727

2828
export class M {
29-
static version = '2.0.4';
29+
static version = '2.1.0';
3030

3131
static Autocomplete: typeof Autocomplete = Autocomplete;
3232
static Tabs: typeof Tabs = Tabs;

0 commit comments

Comments
 (0)