Skip to content

Commit

Permalink
fixes #776 - Array input examples should honor x-fill-example
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed Jul 4, 2022
1 parent 0d215b8 commit a9db0dc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/api-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ export default class ApiRequest extends LitElement {
data-param-serialize-style = "${paramStyle}"
data-param-serialize-explode = "${paramExplode}"
data-param-allow-reserved = "${paramAllowReserved}"
data-x-fill-example = "${param['x-fill-example'] || 'yes'}"
data-array = "true"
placeholder = "add-multiple ↩"
.value = "${
this.fillRequestFieldsWithExample === 'true'
? Array.isArray(example.exampleVal) ? example.exampleVal : [example.exampleVal]
: []
.value="${param['x-fill-example'] === 'no'
? []
: live(this.fillRequestFieldsWithExample === 'true' ? Array.isArray(example.exampleVal) ? example.exampleVal : [example.exampleVal] : [])
}"
>
</tag-input>`
Expand Down Expand Up @@ -447,8 +447,9 @@ export default class ApiRequest extends LitElement {
data-param-serialize-style = "${paramStyle}"
data-param-serialize-explode = "${paramExplode}"
data-param-allow-reserved = "${paramAllowReserved}"
data-x-fill-example = "${param['x-fill-example'] || 'yes'}"
spellcheck = "false"
.textContent = "${this.fillRequestFieldsWithExample === 'true' ? example.exampleVal : ''}"
.textContent="${param['x-fill-example'] === 'no' ? '' : live(this.fillRequestFieldsWithExample === 'true' ? example.exampleVal : '')}"
style = "resize:vertical; width:100%; height: ${'read focused'.includes(this.renderStyle) ? '180px' : '120px'};"
></textarea>
</div>`
Expand Down

0 comments on commit a9db0dc

Please sign in to comment.