Fixed bug #815: Show warning in console if disallowed style combinations appear

This commit is contained in:
Eric Traut 2018-09-14 18:44:31 -07:00
Родитель 3d24cba1b1
Коммит 18e7897add
2 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -195,6 +195,15 @@ export class Styles extends RX.Styles {
}
if (def.flex !== undefined) {
// In development mode, see if we're going to overwrite explicit flexGrow
// or flexShrink attributes. It's a programming error to specify these in
// combination with flex.
if (AppConfig.isDevelopmentMode()) {
if (adaptedRuleSet.flexGrow !== undefined || adaptedRuleSet.flexShrink !== undefined) {
console.error('Conflicting rules for flex specified.');
}
}
let flexValue = def.flex;
delete adaptedRuleSet.flex;
if (flexValue > 0) {

Просмотреть файл

@ -265,6 +265,15 @@ export class Styles extends RX.Styles {
}
if (def.flex !== undefined) {
// In development mode, see if we're going to overwrite explicit flexGrow
// or flexShrink attributes. It's a programming error to specify these in
// combination with flex.
if (AppConfig.isDevelopmentMode()) {
if (def.flexGrow !== undefined || def.flexShrink !== undefined) {
console.error('Conflicting rules for flex specified.');
}
}
let flexValue = def.flex as number;
delete def.flex;