Removing focus

5 posts, 1 answers
  1. Chris Sears
    Chris Sears avatar
    15 posts
    Member since:
    Jul 2006

    Posted 21 Apr 2008 Link to this post

    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.
  2. Andy Wardle
    Andy Wardle avatar
    10 posts
    Member since:
    May 2007

    Posted 23 Apr 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 23 Apr 2008 Link to this post

    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
  5. Andy Wardle
    Andy Wardle avatar
    10 posts
    Member since:
    May 2007

    Posted 23 Apr 2008 Link to this post

    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
  6. Chris Sears
    Chris Sears avatar
    15 posts
    Member since:
    Jul 2006

    Posted 23 Apr 2008 Link to this post

    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!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017