Skip to content

A platform for community discussion. Free, open, simple.

FIX: allow passing custom id to create topic btn (#34952)

David Battersbyc58d6fc87e10
diff --git a/app/assets/javascripts/discourse/app/components/create-topic-button.gjs b/app/assets/javascripts/discourse/app/components/create-topic-button.gjs
index 91591f794b5..0246781c23a 100644
--- a/app/assets/javascripts/discourse/app/components/create-topic-button.gjs
+++ b/app/assets/javascripts/discourse/app/components/create-topic-button.gjs
@@ -8,13 +8,15 @@ export default class CreateTopicButton extends Component {
@tracked btnTypeClass = this.args.btnTypeClass || "btn-default";
@tracked label = this.args.label ?? "topic.create";
+ btnId = this.args.btnId ?? "create-topic";
+
<template>
{{#if @canCreateTopic}}
<DButton
@action={{@action}}
@icon="far-pen-to-square"
@label={{this.label}}
- id="create-topic"
+ id={{this.btnId}}
class={{concatClass @btnClass this.btnTypeClass}}
/>