mirror of
https://github.com/rio-labs/rio.git
synced 2026-01-27 07:48:44 -06:00
minor dropdown improvements
This commit is contained in:
@@ -159,7 +159,7 @@ export abstract class ComponentBase {
|
||||
this.innerAlignElement!.classList.add('stretch-child-x');
|
||||
} else {
|
||||
this.innerAlignElement!.style.left = `${align[0] * 100}%`;
|
||||
this.innerAlignElement!.style.width = 'min-content';
|
||||
this.innerAlignElement!.style.width = 'max-content';
|
||||
this.innerAlignElement!.classList.remove('stretch-child-x');
|
||||
transform += `translateX(-${align[0] * 100}%) `;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ export abstract class ComponentBase {
|
||||
this.innerAlignElement!.classList.add('stretch-child-y');
|
||||
} else {
|
||||
this.innerAlignElement!.style.top = `${align[1] * 100}%`;
|
||||
this.innerAlignElement!.style.height = 'min-content';
|
||||
this.innerAlignElement!.style.height = 'max-content';
|
||||
this.innerAlignElement!.classList.remove('stretch-child-y');
|
||||
transform += `translateY(-${align[1] * 100}%) `;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,11 @@ export class DropdownComponent extends ComponentBase {
|
||||
this._highlightOption(match);
|
||||
});
|
||||
|
||||
match.addEventListener('click', (event) => {
|
||||
// With a `click` handler, the <input> element loses focus for a
|
||||
// little while, which is noticeable because the floating label will
|
||||
// quickly move down and then back up. To avoid this, we use
|
||||
// `mousedown` instead.
|
||||
match.addEventListener('mousedown', (event) => {
|
||||
this.submitInput(optionName);
|
||||
markEventAsHandled(event);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user