Browse Source

FEAT,FIX,IMPRO,REFA: reworked overflow behaviour

dev-feat-component_preview
chris 4 months ago
parent
commit
5dab23dc14
  1. 17
      src/component/Component.js
  2. 3
      src/component/FlexContainerComponent.js

17
src/component/Component.js

@ -82,14 +82,21 @@ class Component extends StyleAndScriptStoringComponent {
* @param {boolean} horizontal Defines if the Component should overflow horizontally (default: false) * @param {boolean} horizontal Defines if the Component should overflow horizontally (default: false)
* @returns {Component} * @returns {Component}
*/ */
overflow(vertical = true, horizontal = false) { overflow(vertical = true, horizontal = false ) {
if (vertical) { if (vertical || horizontal) {
this._modifier.join(
new Modifier()
.removeStyleRule("flex")
.setStyleRule("overflow", "hidden auto")
);
this.subscribeOnGenerate(CommonCompelGroups.OVERFLOWING); this.subscribeOnGenerate(CommonCompelGroups.OVERFLOWING);
this._modifier._modifications["overflow-y"] = "auto"; }
if (vertical) {
this._modifier._modifications["overflow-y"] = "hidden auto";
} }
if (horizontal) { if (horizontal) {
this.subscribeOnGenerate(CommonCompelGroups.OVERFLOWING); this._modifier._modifications["overflow-x"] = "hidden auto";
this._modifier._modifications["overflow-x"] = "auto";
} }
return this; return this;
} }

3
src/component/FlexContainerComponent.js

@ -60,9 +60,8 @@ class FlexContainerComponent extends Component {
}) })
.forEach(icomp => { .forEach(icomp => {
icomp._modifier = new Modifier() icomp._modifier = new Modifier()
.setStyleRule("flex", "none") .removeStyleRule("flex")
.join(icomp._modifier); .join(icomp._modifier);
}); });
} }
return super.childContext(innerComponent); return super.childContext(innerComponent);

Loading…
Cancel
Save