question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adding onfocus event to sap.m.Input

See original GitHub issue

Hi, I don’t know if here is the right place to start a discussion about new features. I’m missing on some classes like Input the onfocus event (especially for adding it in XML view). I know that I can set an event via controller. But in some cases you have a form with a lot of input boxes and it doesn’t make sense and comfort to add these in the controller. Great would be this: <Input onfocus=".myEvent" />

Do you agree? BR

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
boghyoncommented, Nov 25, 2019

@stephania87 The use case can be found here: https://stackoverflow.com/q/58934859/5846045

What I want is a formular and a possibility, that when I navigate e.g. with keyboard through a table with input fields, that every time when I press <kbd>tab</kbd> or arrow <kbd>up/down</kbd> to jump to next input field, the whole content of the box should be selected. (…) Example: https://ui5.sap.com/#/entity/sap.m.Table/sample/sap.m.sample.TableEditable (Click on <kbd>Edit</kbd>). When tabbing, it automatically selects the text. But it doesn’t work with <kbd>up/down</kbd> arrow.

IMHO, controls shouldn’t expose basic browser events to be handled within the view definition. Instead, the actual enhancement request here would be to allow selecting all input text when navigating with <kbd>up/down</kbd> arrow keys, too, in the case of sap.m.ListBase/.Table with the keyboardMode "Edit".

Either way, a simple notepad control would also do the job: https://embed.plnkr.co/98BIbMEIujbzBXqU

0reactions
Martotkocommented, Dec 21, 2020

Since there is no response from the author for more than 4 weeks I’m closing the ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sap.m.Input - How to catch onFocus-Event
Hi, i am new at sapui5 and i try to create my first mobile app. Is there any way to catch the onfocus-event...
Read more >
sap.m.Input - API Reference - Demo Kit - SAPUI5 SDK
class sap.m.Input ... To display suggestions with two text values, add sap.ui.core. ... suggest event is fired when input with no text gets...
Read more >
Best practice to register custom focus event handler for input ...
Sadly, I don't find any focus event for sap.m.Input or sap.m.TextArea to which I can register handlers in XML view.
Read more >
How to trigger event on focus • Post • Neptune Software ...
Can anybody help me trigger an event while focussing on a sap.m.Input field? I have found a solution in adding an event delegate, ......
Read more >
onfocusin Event - W3Schools
The onfocusin event occurs when an element gets focus. The onfocusin event is often used on input fields. Focus Based Events. Event, Description,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found