fix: argument form submit and suggestionsBrowserKey integration config

Call preventDefault at the start of handleSubmit so failed validation
does not trigger a native form submit. Map ascii_sentence inputs to
text. Set ascii_sentence on suggestionsBrowserKey test arguments so
hyphenated values pass validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jamesread 2026-05-11 09:54:50 +01:00
parent ad05659e74
commit f33d764a5f
2 changed files with 18 additions and 16 deletions

View File

@ -174,7 +174,7 @@ function getInputType(arg) {
return 'checkbox' return 'checkbox'
} }
if (arg.type === 'ascii_identifier' || arg.type === 'ascii') { if (arg.type === 'ascii_identifier' || arg.type === 'ascii' || arg.type === 'ascii_sentence') {
return 'text' return 'text'
} }
@ -390,6 +390,8 @@ async function startAction(actionArgs) {
} }
async function handleSubmit(event) { async function handleSubmit(event) {
event.preventDefault()
// Set custom validity for required fields // Set custom validity for required fields
for (const arg of actionArguments.value) { for (const arg of actionArguments.value) {
const value = argValues.value[arg.name] const value = argValues.value[arg.name]
@ -410,8 +412,6 @@ async function handleSubmit(event) {
return return
} }
event.preventDefault()
const argvs = getArgumentValues() const argvs = getArgumentValues()
console.log('argument form has elements that passed validation') console.log('argument form has elements that passed validation')

View File

@ -13,8 +13,10 @@ actions:
- name: testInput - name: testInput
title: Test Input title: Test Input
description: "This input uses suggestionsBrowserKey" description: "This input uses suggestionsBrowserKey"
type: ascii_sentence
suggestionsBrowserKey: test-suggestions-key suggestionsBrowserKey: test-suggestions-key
- name: testInput2 - name: testInput2
title: Test Input 2 title: Test Input 2
description: "This input shares the same suggestionsBrowserKey" description: "This input shares the same suggestionsBrowserKey"
type: ascii_sentence
suggestionsBrowserKey: test-suggestions-key suggestionsBrowserKey: test-suggestions-key