Browse Source

Fix isStyleInFlow

pull/6809/head
Artur Arseniev 2 months ago
parent
commit
7f1ce3a14a
  1. 4
      packages/core/src/canvas/model/Frame.ts
  2. 4
      packages/core/src/style_manager/model/PropertySelect.ts
  3. 2
      packages/core/src/utils/sorter/SorterUtils.ts

4
packages/core/src/canvas/model/Frame.ts

@ -200,6 +200,10 @@ export default class Frame extends ModuleModel<CanvasModule> {
return this.get('component'); return this.get('component');
} }
getMainComponent(): Component {
return this.refComponent || this.root;
}
getStyles() { getStyles() {
return this.get('styles'); return this.get('styles');
} }

4
packages/core/src/style_manager/model/PropertySelect.ts

@ -3,7 +3,7 @@ import { ObjectAny } from '../../common';
import { isDef } from '../../utils/mixins'; import { isDef } from '../../utils/mixins';
import Property, { PropertyProps } from './Property'; import Property, { PropertyProps } from './Property';
type SelectOption = { interface SelectOption {
id: string; id: string;
value?: string; value?: string;
label?: string; label?: string;
@ -12,7 +12,7 @@ type SelectOption = {
title?: string; title?: string;
style?: string; style?: string;
propValue?: ObjectAny; propValue?: ObjectAny;
}; }
/** @private */ /** @private */
export interface PropertySelectProps extends PropertyProps { export interface PropertySelectProps extends PropertyProps {

2
packages/core/src/utils/sorter/SorterUtils.ts

@ -144,7 +144,7 @@ export function closest(el: HTMLElement, selector: string): HTMLElement | undefi
* @private * @private
*/ */
export function isStyleInFlow(el: HTMLElement, parent: HTMLElement): boolean { export function isStyleInFlow(el: HTMLElement, parent: HTMLElement): boolean {
if (isTextNode(el)) return false; if (!el || isTextNode(el)) return false;
const elementStyles = el.style || {}; const elementStyles = el.style || {};
const $el = $(el); const $el = $(el);

Loading…
Cancel
Save