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

Prevent Cortana from trying to use suggested actions in prompts #732

Merged
merged 4 commits into from
Jan 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions libraries/botbuilder-dialogs/src/choices/choiceFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ export class ChoiceFactory {

// Determine list style
const supportsSuggestedActions: boolean = channel.supportsSuggestedActions(channelId, choices.length);
const supportsCardActions: boolean = channel.supportsCardActions(channelId, choices.length);
const maxActionTitleLength: number = channel.maxActionTitleLength(channelId);
const hasMessageFeed: boolean = channel.hasMessageFeed(channelId);
const longTitles: boolean = maxTitleLength > maxActionTitleLength;
if (!longTitles && (supportsSuggestedActions || (!hasMessageFeed && supportsCardActions))) {
if (!longTitles && supportsSuggestedActions) {
// We always prefer showing choices using suggested actions. If the titles are too long, however,
// we'll have to show them as a text list.
return ChoiceFactory.suggestedAction(list, text, speak);
Expand Down