fix: use window.open for GitHub issue creation

- Change from anchor tag to button with explicit window.open
- Ensures click handler properly opens GitHub issue URL
- Add disabled state to button when form is invalid
This commit is contained in:
Rohit Ghumare
2026-01-26 19:44:44 +00:00
parent 4089e5a0be
commit 44da0f8592
+8 -7
View File
@@ -267,8 +267,10 @@ ${form.skillContent.slice(0, 4000)}${form.skillContent.length > 4000 ? '\n...(tr
}
function handleSubmitClick(e: React.MouseEvent): void {
if (!isValid) {
e.preventDefault();
e.preventDefault();
if (isValid) {
const url = generateIssueUrl();
window.open(url, '_blank', 'noopener,noreferrer');
}
}
@@ -527,11 +529,10 @@ ${form.skillContent.slice(0, 4000)}${form.skillContent.length > 4000 ? '\n...(tr
</div>
)}
<a
href={isValid ? generateIssueUrl() : '#'}
target="_blank"
rel="noopener noreferrer"
<button
type="button"
onClick={handleSubmitClick}
disabled={!isValid}
className={`flex items-center justify-center gap-3 w-full py-4 font-mono text-sm transition-all ${
isValid
? 'bg-white text-black hover:bg-zinc-200'
@@ -540,7 +541,7 @@ ${form.skillContent.slice(0, 4000)}${form.skillContent.length > 4000 ? '\n...(tr
>
{GITHUB_ICON}
{isImported ? 'Import to marketplace' : 'Publish skill'}
</a>
</button>
<p className="text-xs text-zinc-600 text-center font-mono">
{isImported