关于试图给新打开的Component第一个focusable元素设置focus的问题
Requirement from https://github.com/SAP/spartacus/issues/9531
Current
While tabbing through the b2b table component, opening up a new section (on the right) is not making the focus to go to the newly opened section, but rather the focus stays where it was (where we pressed enter).
Expected
After opening up a new section, the focus should go to the first element of the section.
How to operate
Go to Unit list Component(let’s say Component A), use tab key to navigate to a give table row, press enter key:
expected behavior:Unit Detail Component(let’s say component B is opened)
The first focusable element in component B, in this case the Edit button, MUST BE FOCUSED automatically.
My failed attempt
add this line in unit-details.component.html:
[cxFocus]="{ autofocus: true }">
this approach does not work:
in debugging, although this.firstFocusable is successfully parsed to point to a.link.edit.disabled
Unfortunately at this timeslot, a tag has “disabled” class set because of line 6:
According to this stackoverflow thread, calling focus method on a disabled element will not work:
only till the time when Unit detail page finishes rendering and its data is loaded successfully, and then I could simply call its native focus() function, and this time it works.
So simply speaking, in my scenario, I would like the execution of following line 64, this.firstFocusable.focus() is delayed until the a.link.edit’s disabled class is removed.
更多Jerry的原创文章,尽在:“汪子熙”:
相关文章
- C# 设置鼠标指针
- flask设置配置文件的四钟方式
- Linux/CentOS服务器 一个网卡绑定多IP地址(永久设置)
- Apache中关于页面缓存的设置
- 关于设置MX记录
- 关于 3750 vlan 设置
- loadrunner12.55 :HTTP Properties > Advanced设置 之 parameterize server names
- python 关于celery的异步任务队列的基本使用(celery+redis)【无配置文件设置】
- 关于虚拟机virtualbox使用无线卡上网的设置
- Linux下定时任务设置
- SPSS输出结果如何在word中设置小数点前面显示加0
- Mac下设置Android源代码编译环境
- Qt中设置QTabWidget的选项卡自适应宽度拉伸填充
- 关于使用 SAP UI5 代码设置应用 theme 的技巧
- 关于Business Document save时是否设置distribution lock的问题
- Eclipse里代码自动完成 auto completion的快捷键设置
- MySQL配置和设置问题小结
- Android 10.0 cache目录下恢复出厂设置不会被删除的文件的修改
- 设备和面向类的函数 基本的终端接口 termios termios 机构 取得前台进程组的 ID 设置前台进程组 ID 行控制函数 获得并设定状态 接口特性 波特率函数 基本的终端接口控制函数
- 如何设置Win11弹出外置硬盘
- lotus v1.10.0 扇区消息上链设置不聚合
- 关于窗口风格的设置