Problem with focus and disabled state

4 posts, 0 answers
  1. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 05 Feb Link to this post

    Hello,

    I'm working with the Office 2013 theme, perhaps the problem is not visible in other theme.

    I have a WPF application with a combo box that can be enabled/disabled with a click on a button on the ribbon. Clicking on the button doesn't change the focus (that's important).

    I the combo box is enabled and has the focus, pressing the ribbon button disables the combo box, but it stilll shows that it has the focus. When moving the focus to another control, the combo box still shows the focus state.

    I think that the focus state should only be displayed when the combo box is enabled.

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 08 Feb Link to this post

    Hi Patrick,

    I have tried the scenario, but didn't manage to recreate the described issue -  please check the attached video, am I missing something? Can you send us some sample code showing the exact setup you have?

    Looking forward to your reply.

    Regards,
    Yana
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 08 Feb in reply to Yana Link to this post

    Hi Yana,
    the difference is that your button is taking the focus out of the combo box when clicked.
    My button is on the ribbon, so it doesn't take the focus when clicked and the focus is still on the combo box when it is disabled.

  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 08 Feb Link to this post

    Hello Patrick,

    I am sorry I missed that.  We were able to reproduce the reported issue, I have logged it in our Feedback Portal and you can track its progress at the following link:
    http://feedback.telerik.com/Project/143/Feedback/Details/182266-radcombobox-does-not-update-its-focused-state-when-disabled

    In the meantime, as a workaround, you can manually update the focused state of the ComboBox before disabling it with the following code:

    if (this.comboBox.IsKeyboardFocusWithin)
    {
       VisualStateManager.GoToState(this.comboBox, "Unfocused", false);               
    }

    I have updated your points as a small sign of gratitude for your involvement.

    Regards,
    Yana
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top