Skip to content

Commit

Permalink
fix:Fix the bug that synchronization of disabled and gray of UICompon…
Browse files Browse the repository at this point in the history
…ent causes ide to be unable to update properties separately.(修复UIComponent的disabled和gray同步导致ide无法分开更新属性的bug)
  • Loading branch information
zringhost11 committed Aug 31, 2023
1 parent c373073 commit 3e73d98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layaAir/laya/ui/UIComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Node } from "../display/Node"
import { Sprite } from "../display/Sprite"
import { Event } from "../events/Event"
import { ILaya } from "../../ILaya";
import { SerializeUtil } from "../loaders/SerializeUtil";

/**
* <code>Component</code> 是ui控件类的基类。
Expand Down Expand Up @@ -327,7 +328,9 @@ export class UIComponent extends Sprite {

set disabled(value: boolean) {
if (value !== this._disabled) {
this.gray = this._disabled = value;
this._disabled = value;
if (!SerializeUtil.isDeserializing)
this.gray = value;
this.mouseEnabled = !value;
}
}
Expand Down

0 comments on commit 3e73d98

Please # to comment.