Giter Site home page Giter Site logo

Comments (2)

aborjinik avatar aborjinik commented on May 29, 2024

Hi Holger,

That could be a nice improvement but I personally like separation of concerns. So, one dedicated function for delay, one dedicated function for focus, and one dedicated function for text selection.

With supposedly API .....focus( [selectText], [delay] );
What if something happens during delay, how can I cancel the timer and focus? Or what if someone needs more convenience to select a part of the text. For me, it is also hard to explain this magic numbers(100ms) from the API. I would ask in code review why not 99 :)

So I think it is better to give all options from framework and applications can write so-called static focus API easily with using these functions.

BTW, iOS safari was accepting programmatical focus only with user interaction(not tested with ios7 though). Are you sure you r not doing any interaction during this time.

Thanks for your feedback,
Cahit

from openui5.

hschaefer123 avatar hschaefer123 commented on May 29, 2024

Hi Cahit,
sorry for the delay, but i have been on holidays.

From a SOC point i can agree. But in a lot of UI5 apis like json model.load, etc., there are a lot of params (and event not all params for the underlying ajax call) that does not fullfill SOC! I liked the Sencha approach, that nearly all function accept a params list or an object as first param holding additional config options. Especially for model.load(oOptions) i would be able to passthorugh all ajax options and do not have to reimplement the whole function for some small changes.

But i will use my own prototyped focus method concerning delay, because i have a default delay which i can change centrally if an upcomming iOS release will no more fir 100mx. Maybe the UI5 implementation is a little bit more clever conercening rerendering and refocus handling.

Concerning iOS7, i just finshed our WM Tipp game

https://wmtipp.uniorg.de/

where you can check out the delayed focus keyboard handling. It will focus the email field on first loging and then store your email in localstorage. Next time the email will be set by former localstorage value and password will be focused.

The WM Tipp was the reason for my last 6 ticket where 3 of them has been luckily fixed:

There is a nice rumble animation on wrong login. i will write a blog post on my experiences concerning developing that tipp game device independantly.

Thanks for your comments.

Cheers Holger

from openui5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.