Page 1 of 1

"Focus Border" appears on region withTabStop = False

PostPosted: 10 Jul 2018 15:15
by MCarver
CG Gurus:

Even though I have set the
myCGRegion.TabStop := False;
myCGRegion.TabIndex := False;
A “focus border” appears around the region whenever a user clicks on it. Stripping that "tabindex" style from the rendered html avoids this behavior.

Shouldn't these properties (namely TabStop) automatically strip the "tabindex" style from the cgregion.

Please advise as I would rather avoid the extra code to strip this style.

Regards,
Monte Carver

Re: "Focus Border" appears on region withTabStop = False

PostPosted: 17 Jul 2018 09:15
by Alexander Bulei
Hi MCarver,

I don't see that behavior..
Pleae provide the steps or the simple testcase.
Tia.

Best Regards.

Re: "Focus Border" appears on region withTabStop = False

PostPosted: 17 Jul 2018 17:05
by MCarver
Alexander,

Thank you for the prompt attention.

This is the rendered DIV of the CGRegion, where
TabIndex := False
TabStop := False

<div class="ui-widget ui-widget-content" id="REGHEADER" style="" tabindex="-1"

As mentioned, this resulting tabindex renders a blue border in chrome when selected. Stripping the tabindex removes the border. I had expected that setting the TabIndex := False to do this automatically.

Reviewing CG's source in the unit IWCGJQRegions.pas
Line 720
Code: Select all
if NOT TabStop then
    Result.AddIntegerParam('tabindex',-1)


Changing it to read the following strips the tabindex as expected.

Code: Select all
if TabStop then
    Result.AddIntegerParam('tabindex',-1)


Is this not a bug? Why is it adding a "tabindex" when TabStop = FALSE?

Please advise.
Thank you for your attention on this matter.

Regards,
Monte Carver

Re: "Focus Border" appears on region withTabStop = False

PostPosted: 19 Jul 2018 14:09
by Alexander Bulei
Hi MCarver,

Is this not a bug? Why is it adding a "tabindex" when TabStop = FALSE?


No, its not. It's OK with tabindex.

Just define the custom css style to remove that border :

css code
*:focus {outline:none !important}


It's a default behavior of cchrome browser.

Best Regards.