/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
render() { const value = parseFloat(this.props.value); const unit = getUnitFromValue(this.props.value);
let max; switch (unit) { case"em": case"rem":
max = 4; break; case"vh": case"vw": case"vmin": case"vmax":
max = 10; break; case"%":
max = 200; break; default:
max = 72; break;
}
// Allow the upper bound to increase so it accomodates the out-of-bounds value.
max = Math.max(max, value); // Ensure we store the max value ever reached for this unit type. This will be the // max value of the input and slider. Without this memoization, the value and slider // thumb get clamped at the upper bound while decrementing an out-of-bounds value. this.historicMax[unit] = this.historicMax[unit]
? Math.max(this.historicMax[unit], max)
: max;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.