Skip to content

Commit

Permalink
feat(ios): add Ti.UI.TextField/Area focused property
Browse files Browse the repository at this point in the history
Fixes TIMOB-27711
  • Loading branch information
sgtcoolguy committed Jun 22, 2020
1 parent c5de6e2 commit 19ab4dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iphone/Classes/TiUITextWidgetProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
- (void)noteValueChange:(NSString *)newValue;

@property (nonatomic, readwrite, assign) BOOL suppressFocusEvents;
// workaround bridge layer issue clashing with focused:(id)unused method
// To expose a "focused" property to JS
@property (readonly, getter=isFocused) BOOL focused;

@end

Expand Down
6 changes: 6 additions & 0 deletions iphone/Classes/TiUITextWidgetProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ - (void)focus:(id)args
}
}

// This is exposed to JS as "focused" property
- (BOOL)isFocused
{
return [self focused:nil];
}

- (BOOL)focused:(id)unused
{
if (![NSThread isMainThread]) {
Expand Down

0 comments on commit 19ab4dc

Please sign in to comment.