Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Make it possible to mark a button as disabled #4257

Closed
5 tasks
dclaux opened this issue Jun 30, 2020 · 3 comments
Closed
5 tasks

[Feature] Make it possible to mark a button as disabled #4257

dclaux opened this issue Jun 30, 2020 · 3 comments

Comments

@dclaux
Copy link
Member

dclaux commented Jun 30, 2020

Description

In some scenarios, multiple actions might be presented in a card in an Outlook Actionable Message. As the user presses invokes these actions, the card might be refreshed and some of the actions that were previously available might not be available anymore.

Let's take the example of a card with two mutually exclusive actions, A and B (clicking A makes B unavailable, and the other way around):

  • Initial card has buttons for both A and B
  • User click A
  • The card gets refreshed
  • In that refreshed card, the button for A is replaced by a label reading "Done!"
  • But what about B? There are two things that can be done:
    • Either B is still there. When the user clicks it, they get an error that B cannot be done anymore because A was done before
    • Or B is gone

Describe the solution you'd like

In some cases, neither of the above two solutions are great, especially if B is visually represented as a button. What should really happen is:

  • B is still there, but is disabled (both visually and functionally)

This allows the user to understand that clicking on A lead to not being able to click on B anymore, using a known UI pattern.

Design

The goal of this feature is to make it possible to craft cards in which actions are permanently disabled. If an action is marked as disabled, there is no way to re-enable it by simply interacting with the card on the client.

We will add a boolean isEnabled property to all actions. isEnabled defaults to true. When set to false, the card element associated with the action is functionally and visually disabled:

  • Buttons have a disabled appearance and do not respond to clicks/taps/keyboard invocation. That includes action buttons for the card's actions property, for an ActionSet's actions as well as for the inlineAction of a TextInput.
  • Images or other elements with a disabled selectAction look and behave as if they had no selectAction.

Visuals for disabled buttons (just like for enabled buttons) are up to each SDK and platform. Developers should be able to customize the visuals of disabled buttons using native styling; there will not be any HostConfig changes for this.

Downlevel clients which do not understand the isEnabled property will simply ignore it which mean the actions will remain enabled. It is up to the card author to deal with this constraint and craft their card so as to provide an acceptable user experience.

Implementation Platforms

  • JS
  • .NET WPF
  • Android
  • iOS
  • UWP
@shalinijoshi19
Copy link
Member

shalinijoshi19 commented Jun 30, 2020

@RebeccaAnne FYI and also to weigh in.

@dclaux
Copy link
Member Author

dclaux commented Jul 20, 2020

This feature has been approved for inclusion in a future version of AC (likely 1.4). The chosen design is to introduce an isEnabled property. This issue will be updated with a more complete spec to cover the details of how isEnabled will work.

@paulcam206
Copy link
Member

this has been implemented (see schema docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants