-
Notifications
You must be signed in to change notification settings - Fork 998
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
SPFx Commandset title not changing #1177
Comments
Just a notice that this is still an issue - Is there a ETA for a fix for this? |
Hey guys. Trying to make this work. |
Ran into this issue today. It seems as if the HTML for a Command is generated once and then shown/hidden depending on the .visible property? In #6245 @andrewconnell states that "Dynamically switching the title is not supported". However the documentation of the Command class title property suggests it should be possible and as an example even describes a scenario that is, for all intents and purposes, the same as the one described by @maliksahil. Any ETA for a solution? |
It's my understanding that you can't change the title of a command set button/link. The reason why is because it's defined in the manifest for the component where you can also localize the title. Microsoft needs to confirm that, but that's my undersatnding. |
If so, then the docs are out of date or at least incorrect, in the ones mentioned by @tripleseven73 they say:
I also feel like this used to work, and was included in some demos from Microsoft, but I don't have the links to back it up. |
I double-checked with the SPFx engineering team and the docs are correct; the |
Has there been any update on this? It seems insignificant but having the ability to change "selected document" to "selected documents" is actually quite valuable to UX 😇 (Even more so for languages with greater changes in singular v. plural) |
sent a proposal to a customer that requires this feature and I'm stuck now. I'm implementing adding/removing documents to personal favourites and I need the ability to change the command title. Appreciate it if you provide a ETA for a fix. |
Hi, we are waiting for this fix too, the ability to dynamically set title of our commands is crucial for us :) |
The title can be changed on execute (as of a month ago), but not on listview updated. The latter is tracked by #7375 |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.
Category
Expected or Desired Behavior
I'm using node 6.12, npm 3.10, and SPFx 1.4 on a Modern site.
I generate a commandset extension (new project), deploy - everything works as expected.
Now, I want to change the logic .. I want to show change the title of "COMMAND_1" to reflect the number of rows selected.
I change my onListViewUpdated as follows,
public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void {
const compareOneCommand: Command = this.tryGetCommand('COMMAND_1');
if (compareOneCommand) {
// This command should be hidden unless exactly one row is selected.
compareOneCommand.visible = event.selectedRows.length > 0;
console.log(event.selectedRows.length);
compareOneCommand.title = "Selected " + event.selectedRows.length;
}
}
Now I go about selecting rows - but even though in debug mode event.selectedRows.length shows me the correct value, and compareOneCommand.title shows the proper value, the in UX, the title always says "Selected 0".
Expected: Selected x .. where x is number of rows selected.
Observed Behavior
The title always says "Selected 0" which is incorrect.
Steps to Reproduce
As above ..
Thanks for your contribution! Sharing is scaring.
The text was updated successfully, but these errors were encountered: