Hi !,
I am using Navigation Tabs in reactive web application, I have been trying to disable switching of tabs "onkeypress" of left and right arrow keys,
I have tried this thread https://www.outsystems.com/forums/discussion/82128/outsystems-ui-is-there-a-way-to-disable-arrow-keys-from-changing-tabs-in-reacti/ but when the input box in tab content is focused on , the arrow key allows to switch tabs,
I have achieved the expected result by overwriting the javascript for entire screen by changing the condition, Any alternative to disable the particular Outsystem event or disable or override,
Thanks team.
Hello @Vasudevan Natesan,
Can you please mention the OS UI version you're using?About adding the code to a specific Tab instance you can do it by getting the object instance (Tabs are javascript objects and each component on a screen has its own instance).
In order to achieve that you can add the following code to the OnReady event of the screen/block where you're using the Tabs (in the future almost all components will have the Initialized event where we should do this, but until then we need to add in the OnReady):
var x = OutSystems.OSUI.Patterns.TabsAPI.GetTabsById($parameters.TabsWidgetId); x._handleKeypressEvent = (e) => { if(e.code === "ArrowLeft" || e.code === "ArrowRight") { e.preventDefault(); } }
Update: This was fixed in version 2.15.0, in the context of ROU-4198 for reference on the release notes.
Cheers,GM
You could take a look at this approach by Bernardo Cardoso: OutSystems UI Extensibility: Part II
What you need to do is findding a way to overwrite the "_handleKeypressEvent" callback within the Tabs class.
HI Vasudevan,
Would you provide some screenshots to better understanding what you want to achieve.
Regards
Deep
In case someone stumbles upon this issue.This was fixed in 2.15.0 version of OutSystemsUI.
https://www.outsystems.com/forge/component-versions/1385/version/0/platform/
ROU-4198 - Fixed an issue that caused the Tabs component to change tabs when pressing the arrow keys when the focus is on the Tabs content.
Now, the Tabs component just changes tabs when the active Tab Header is focused and the right/left arrow keys are pressed.