Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 755c612

Browse files
committedFeb 14, 2020
fix: span/formattedstring fixes for ios too
1 parent 37c8df8 commit 755c612

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed
 

Diff for: ‎src/label-common.ts

+22
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ import { Label as TNLabel } from 'tns-core-modules/ui/label';
55
import { Style } from 'tns-core-modules/ui/styling/style';
66
import { layout } from 'tns-core-modules/utils/utils';
77
import { Label as LabelViewDefinition, TextShadow } from './label';
8+
import { FormattedString } from 'tns-core-modules/text/formatted-string';
9+
import { Span } from 'tns-core-modules/text/span';
10+
11+
12+
declare module 'tns-core-modules/text/formatted-string' {
13+
interface FormattedString {
14+
addPropertyChangeHandler(): void;
15+
removePropertyChangeHandler(): void;
16+
}
17+
}
18+
declare module 'tns-core-modules/text/span' {
19+
interface Span {
20+
addPropertyChangeHandler(): void;
21+
removePropertyChangeHandler(): void;
22+
}
23+
}
24+
25+
FormattedString.prototype.addPropertyChangeHandler = function() {}
26+
FormattedString.prototype.removePropertyChangeHandler = function() {}
27+
Span.prototype.addPropertyChangeHandler = function() {}
28+
Span.prototype.removePropertyChangeHandler = function() {}
29+
830

931
export const cssProperty = (target: Object, key: string | symbol) => {
1032
// property getter

Diff for: ‎src/label.android.ts

-9
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,14 @@ Font.prototype.getAndroidTypeface = function() {
5959
declare module 'tns-core-modules/text/formatted-string' {
6060
interface FormattedString {
6161
toNativeString(): string;
62-
addPropertyChangeHandler(): void;
63-
removePropertyChangeHandler(): void;
6462
}
6563
}
6664
declare module 'tns-core-modules/text/span' {
6765
interface Span {
6866
toNativeString(): string;
69-
addPropertyChangeHandler(): void;
70-
removePropertyChangeHandler(): void;
7167
}
7268
}
7369

74-
FormattedString.prototype.addPropertyChangeHandler = function() {}
75-
FormattedString.prototype.removePropertyChangeHandler = function() {}
76-
Span.prototype.addPropertyChangeHandler = function() {}
77-
Span.prototype.removePropertyChangeHandler = function() {}
78-
7970
FormattedString.prototype.toNativeString = function() {
8071
let result = '';
8172
const length = this._spans.length;

0 commit comments

Comments
 (0)
Please sign in to comment.