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');
}
getMainComponent(): Component {
return this.refComponent || this.root;
}
getStyles() {
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 Property, { PropertyProps } from './Property';
type SelectOption = {
interface SelectOption {
id: string;
value?: string;
label?: string;
@ -12,7 +12,7 @@ type SelectOption = {
title?: string;
style?: string;
propValue?: ObjectAny;
};
}
/** @private */
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
*/
export function isStyleInFlow(el: HTMLElement, parent: HTMLElement): boolean {
if (isTextNode(el)) return false;
if (!el || isTextNode(el)) return false;
const elementStyles = el.style || {};
const $el = $(el);

Loading…
Cancel
Save