mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00

recycleNativeView filed now accepts: "always" | "never" | "auto". Always will recycle the nativeView no matter if its nativeView or android proprties are accessed. Never will disable recycling. Auto will recycle it only if nativeView and android properties are not accessed.
21 lines
607 B
TypeScript
21 lines
607 B
TypeScript
import { Button as ButtonDefinition } from ".";
|
|
import { TextBase, booleanConverter } from "../text-base";
|
|
|
|
export * from "../text-base";
|
|
|
|
export abstract class ButtonBase extends TextBase implements ButtonDefinition {
|
|
public static tapEvent = "tap";
|
|
|
|
get textWrap(): boolean {
|
|
return this.style.whiteSpace === "normal";
|
|
}
|
|
set textWrap(value: boolean) {
|
|
if (typeof value === "string") {
|
|
value = booleanConverter(value)
|
|
}
|
|
|
|
this.style.whiteSpace = value ? "normal" : "nowrap";
|
|
}
|
|
}
|
|
|
|
ButtonBase.prototype.recycleNativeView = "auto"; |