Skip to content

Commit

Permalink
Merge pull request #98 from CSCfi/686-fix-autocomplete-blur
Browse files Browse the repository at this point in the history
Fix: c-autocomplete: Clicking outside de-activates the field properly
  • Loading branch information
razorfever authored Jan 10, 2024
2 parents 9d0c3b6 + 3fe1486 commit e4f54a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/csc-ui/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export namespace Components {
}
interface CDropdown {
/**
* Open dropdown
* Close dropdown
*/
"close": () => Promise<void>;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/csc-ui/src/components/c-dropdown/c-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class CDropdown {
}

/**
* Open dropdown
* Close dropdown
*/
@Method()
async close() {
Expand Down
2 changes: 1 addition & 1 deletion packages/csc-ui/src/components/c-dropdown/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

### `close() => Promise<void>`

Open dropdown
Close dropdown

#### Returns

Expand Down
7 changes: 3 additions & 4 deletions packages/csc-ui/src/components/c-input/c-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,9 @@ export class CInput {
private _onBlur = () => {
// delay the blur event to prevent the label from 'flashing' on c-select selection
setTimeout(() => {
if (!this.active) {
this.isFocused = false;
this._hasBlurred = true;
}
this.isFocused = false;

this._hasBlurred = true;

// show the label if there's no label or value
this._onReset();
Expand Down

0 comments on commit e4f54a4

Please sign in to comment.