Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-ui",
"version": "3.1.3-8",
"version": "3.1.3-9",
"description": "UI library for Solid applications",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/Button.styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
}

:host(:has([slot="icon"])) button {
:host([data-has-icon-slot]) button {
padding: 4px;

::slotted([slot="icon"]) {
Expand Down
8 changes: 7 additions & 1 deletion src/components/button/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ export default class Button extends WebComponent {
<button type=${this.type} ?disabled=${disabled} @click=${this.onClick}>
${this.loading ? html`<icon-svg-spinners-180-ring></icon-svg-spinners-180-ring>` : nothing}
<slot name="left-icon"></slot>
<slot name="icon"></slot>
<slot @slotchange=${this.onIconSlotChange} name="icon"></slot>
<slot></slot>
<slot name="right-icon"></slot>
</button>
`
}

private onIconSlotChange (e: Event) {
const slot = e.target as HTMLSlotElement

this.toggleAttribute('data-has-icon-slot', slot.assignedElements().length > 0)
}

private onClick () {
switch (this.type) {
case 'submit':
Expand Down
7 changes: 5 additions & 2 deletions src/components/combobox/Combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class Combobox extends WebComponent {
aria-labelledby=${this.label ? this.inputTrait.labelId : nothing}
aria-label=${this.label ? nothing : accessibleName}
?hidden=${!this.open}
@mouseup=${this.onListboxMouseUp}
@mousedown=${this.onListboxMouseDown}
>
${options.map(
(option, index) =>
Expand Down Expand Up @@ -225,6 +225,7 @@ export default class Combobox extends WebComponent {
return
}

this.filter = ''
this.open = false
this.activeIndex = -1
this.removeOpenListeners()
Expand Down Expand Up @@ -358,7 +359,9 @@ export default class Combobox extends WebComponent {
}
}

private onListboxMouseUp (event: MouseEvent) {
private onListboxMouseDown (event: MouseEvent) {
event.preventDefault()

if (!(event.target instanceof HTMLElement)) {
return
}
Expand Down
Loading