Skip to content

Commit 1a9caa3

Browse files
committed
ios: handle resetting color
1 parent 2752a6e commit 1a9caa3

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

ios/EnrichedMarkdown.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,8 @@ - (void)applySelectionColor:(const EnrichedMarkdownProps &)props toTextView:(ENR
901901
#if !TARGET_OS_OSX
902902
if (isColorMeaningful(props.selectionColor)) {
903903
ENRMSetSelectionColor(textView, RCTUIColorFromSharedColor(props.selectionColor));
904+
} else {
905+
ENRMSetSelectionColor(textView, nil); // resets to inherited / system tint
904906
}
905907
#endif
906908
}

ios/EnrichedMarkdownText.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
416416
#if !TARGET_OS_OSX
417417
if (isColorMeaningful(newViewProps.selectionColor)) {
418418
ENRMSetSelectionColor(_textView, RCTUIColorFromSharedColor(newViewProps.selectionColor));
419+
} else {
420+
ENRMSetSelectionColor(_textView, nil); // resets to inherited / system tint
419421
}
420422
#endif
421423
}

ios/input/EnrichedMarkdownTextInput.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
292292
if (newViewProps.selectionColor != oldViewProps.selectionColor) {
293293
if (isColorMeaningful(newViewProps.selectionColor)) {
294294
ENRMSetSelectionColor(_textView, RCTUIColorFromSharedColor(newViewProps.selectionColor));
295+
} else {
296+
ENRMSetSelectionColor(_textView, nil); // resets to inherited / system tint
295297
}
296298
}
297299

0 commit comments

Comments
 (0)