Hi,
This behavior is not coming from your custom React widgets directly, but from how Mendix renders pages in combination with standard browser behavior.
In Mendix, most interactive elements (links, buttons, inputs) are rendered with a default tabindex (usually 0). This makes them part of the natural tab order.
When the page loads, the browser determines the first focusable element in the DOM. In some cases (depending on structure and timing), the browser will automatically place focus on that first element. Since Mendix ensures components are accessible by default, your first link becomes the initial focus target even if you did not explicitly configure it.
So this is essentially:
There is no global Mendix setting to disable this behavior, but you can control it in a few ways:
tabIndex={-1}
setTimeout(() => {
document.activeElement?.blur();
}, 0);
This is mainly for accessibility. By ensuring elements are focusable and part of the tab sequence, Mendix aligns with standard web accessibility practices. It helps keyboard navigation and screen reader users interact with the application correctly.
tabindex, or by controlling focus via JavaScriptIn most cases, the recommended approach is to manage focus explicitly rather than trying to completely disable it.
The reason is to enable keyboard navigation.
To disbale the tab index set it to a value < 0
Which element get the focus is probably determine by the order in the page elements when the tabindex is the same for the different elements