Content-Length: 277646 | pFad | http://github.com/ZanePoe/NativeScript/commit/c3a7ed818fd45fcaeef95ff81a58b75c1bfdbc87

A7 Merge pull request #1771 from NativeScript/formatted-text-fix · ZanePoe/NativeScript@c3a7ed8 · GitHub
Skip to content

Commit c3a7ed8

Browse files
committed
Merge pull request NativeScript#1771 from NativeScript/formatted-text-fix
Prevent stack overflow when re-applying iOS formatted text
2 parents de8b6d8 + 48704f1 commit c3a7ed8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ui/text-base/text-base.ios.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@ export class TextBase extends common.TextBase {
1717
this.requestLayout();
1818
}
1919

20+
private _settingFormattedTextPropertyToNative = false;
2021
public _onStylePropertyChanged(property: dependencyObservable.Property): void {
22+
if (this._settingFormattedTextPropertyToNative) {
23+
// Guard against stack-overflow.
24+
return;
25+
}
26+
2127
if (this.formattedText) {
2228
// Re-apply the formatted text to override style changes if needed.
2329
// https://github.com/NativeScript/NativeScript/issues/1078
30+
this._settingFormattedTextPropertyToNative = true;
2431
this._setFormattedTextPropertyToNative(this.formattedText);
32+
this._settingFormattedTextPropertyToNative = false;
2533
}
2634
}
2735
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ZanePoe/NativeScript/commit/c3a7ed818fd45fcaeef95ff81a58b75c1bfdbc87

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy