FLP:在应用启动时设置自定义初始焦点失败 [英] FLP: Setting Custom Initial Focus on App Launch Fails

查看:28
本文介绍了FLP:在应用启动时设置自定义初始焦点失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将初始焦点设置到我应用的每个页面中的第一个输入字段.

我已经实现了以下帖子中的代码并且运行良好:

来自 sap/ushell/renderers/fiori2/Shell-dbg.controller.js

你能帮忙解决这个问题吗?我使用的是 SAP UI5 版本 1.56.7.

解决方案

那个答案的作者在这里.在浏览源代码和文档一段时间后,我不得不承认我也找不到任何可接受的解决方案来解决这个问题.我的印象是 FLP 开发人员希望确保应用程序不会干扰设置初始焦点.

API 及其文档的缺乏强烈表明这种预防措施背后有令人信服的原因(可能与 11y 相关).

我的建议是不要依赖超时,而是通过在发布时将重点放在应用标题上来保持一致的用户体验 - 正如 SAP 设计的那样.

I am trying to set initial focus to the first input field in each page of my app.

I have implemented the code in the following post and it is working great:

How to Set Initial Focus in a View?

But I found that it is not working for first view/page in app when it opens from Fiori Launchpad. I found the following code which is getting executed after my onAfterShow:

From sap/ushell/renderers/fiori2/Shell-dbg.controller.js

Could you please help to solve this? I am using SAP UI5 version 1.56.7.

解决方案

Author of that answer here. After browsing through the source code and documentation quite a while, I have to admit I couldn't find any acceptable solutions to this question either. My impression is that FLP developers want to make sure that the app doesn't interfere with setting the initial focus.

The lack of APIs and documentation thereof strongly suggests that there are compelling reasons behind this prevention (probably a11y related).

My advice is not to rely on timeouts but maintaining consistent UX by keeping the focus on the app title on its launch - as designed by SAP.

这篇关于FLP:在应用启动时设置自定义初始焦点失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆