Commit fe30050
authored
feat: unify initial text/html iOS emitting with Android (#270)
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->
# Summary
After the latest PRs it also came to my mind that Android and iOS emit
the initial events a bit differently. If we have some `defaultValue`
set, iOS wouldn't emit text (and would emit html always, even if
`defaultValue` was not set), while Android properly emitted both html
and text only if the prop is set.
This PR changes:
- initial `recentlyEmittedHtml` value so that it doesn't emit with no
`defaultValue`
- sets `recentlyEmittedString` only if the `onChangeText` event properly
wen through (event emitter was defined). This way text emits if it's
different than the initial `""`
## Test Plan
Run the example iOS app once with no `defaultValue` and the other time
with `defaultValue`. Observe that in the first scenario no initial
events are dispatched, while in the second they are emitted as soon as
emitter is ready.
## Screenshots / Videos
--
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ✅ |
| Android | ✅ (was fine already) |1 parent 89ca463 commit fe30050
1 file changed
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1059 | 1065 | | |
1060 | 1066 | | |
1061 | 1067 | | |
| |||
1064 | 1070 | | |
1065 | 1071 | | |
1066 | 1072 | | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
| |||
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
1094 | 1097 | | |
1095 | 1098 | | |
1096 | 1099 | | |
1097 | 1100 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
| |||
0 commit comments