Nativescript: Feature Request: Focus / Blur events

Created on 26 May 2016  路  8Comments  路  Source: NativeScript/NativeScript

Pretty self-explanatory. It would be useful to have focus and blur events (to mirror the DOM terminology) that are raised for a textfield, searchbar, or any other controls that can gain or lose focus. Also would be good to have a way to determine if a view currently has focus or not, like a hasFocus property.

feature

Most helpful comment

Alongside this pseudo selectors would be needed for theme project:

TextField:focus {  color: blue; }

for example.

All 8 comments

Alongside this pseudo selectors would be needed for theme project:

TextField:focus {  color: blue; }

for example.

I can't believe there is no focus and blur event.

Has someone found a workaround?

You may emulate focus/blur event with tap event and other. It is temporary decision, but it is works fine

FYI: There is a blur event these days. I'm thinking of doing a PR for focus as well.

4730 pending review 馃

This feature will be added in the next release? I find it really important

@nabil-mansouri The PR has been merged, so 3.2 it will be - and you can grab tns-core-modules@next right now if you can't wait! 馃槂

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valentinstoychev picture valentinstoychev  路  3Comments

yclau picture yclau  路  3Comments

Leo-lay picture Leo-lay  路  3Comments

pocesar picture pocesar  路  3Comments

NordlingDev picture NordlingDev  路  3Comments