This is a migrated thread and some comments may be shown as answers.

Removing focus

4 Answers 207 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Chris Sears
Top achievements
Rank 1
Chris Sears asked on 21 Apr 2008, 05:41 PM
In the out-of-the-box skins, RadToolBarItems have a different look when focused. The focus effect stays in place until the user moves focus to another element in the page. There are quite a few cases where this is undesirable and the button should revert to its normal look as soon as the click is complete.

Overriding the styles has limitations, and seems like it could cause issues when the control is upgraded in the future. You end up overriding all sorts of classes like .rtbIn, .rtbWrap, .rtbMid, etc.

The FocusedCssClass property seemed like a good solution, but it used to supplement rather than override the default focused class.

As an interim solution, I simply call focus() then blur() on a different ToolBarItem (or any visible form element). This works like a charm, but I'd rather not use such a hack.

I guess I'd like to know why the focused buttons behave the way they do in the default skins. It makes them feel more like toggle buttons and winds up confusing the user. It feels great that the buttons "light-up" when you click on them, but keeping them lit up until focus is lost feels unnatural and serves little purpose.

4 Answers, 1 is accepted

Sort by
0
Andy Wardle
Top achievements
Rank 1
answered on 23 Apr 2008, 10:00 AM
I'm having the same issue as Chris. Using the focus() and blur() trick works great for buttons that are enabled, but in some cases I disable a button after it has been clicked and when this happeneds the focus() and blur() trick doesn't work and button stays in the 'clicked' mode whilst it is disabled (even when it becomes enabled again focus() and blur() won't remove the 'clicked' effect).

Any update on a way of stopping the buttons from keeping the 'clicked' state once the mouse button is released would be great.

Thanks,
Andy
0
Accepted
Erjan Gavalji
Telerik team
answered on 23 Apr 2008, 11:16 AM
Hi guys,

Thanks for your comments!

We decided to rework the focus behavior of the RadToolBar in a manner, that will avoid the visual glitch. Let me explain:

The problem happens, because we use similar look for focused and hovered items. When a button get clicked it stays focused until the user clicks somewhere else on the page. We discussed two possible solutions - either to change the look of the focused item, or not to apply the focused style when a mouse click happens.

We chose the second option - when navigating through the keyboard the focused style will be used, but if the mouse used, only the hover style will be used.

We are working on fixing the behavior for the first service pack of the suite. Let me know if the time is critical for any of you so that we can prepare an unofficial build once the fix is ready.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Andy Wardle
Top achievements
Rank 1
answered on 23 Apr 2008, 12:27 PM
Thanks for the quick reply.

In my case this isn't that urgent and I can wait for the Service pack to be released.

Thanks,
Andy
0
Chris Sears
Top achievements
Rank 1
answered on 23 Apr 2008, 02:04 PM
This sounds like a good solution. I have a hack in place that works around the problem, so getting the fix quickly isn't critical for me.

Thanks!
Tags
ToolBar
Asked by
Chris Sears
Top achievements
Rank 1
Answers by
Andy Wardle
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Chris Sears
Top achievements
Rank 1
Share this question
or