Skip to content

Commit

Permalink
fix: select indicator click
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtianze committed Aug 22, 2023
1 parent fe9ef9e commit e2f61b3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/i18n/language/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const en: I18NInterface = {
end_date: 'End Date',
select_date: 'Select Date',
select_time: 'Select time',
clear: 'clear',
clear: 'Clear',
confirm: 'Confirm',
to: 'To',
year_suffix: '',
Expand Down
2 changes: 1 addition & 1 deletion src/icon/icons.ts

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/input/input-group/input-group.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
left: calc(#{use-var(inline-padding-xs)} + 1px);
transform: translateY(-50%);
color: use-text-color(secondary);
pointer-events: none;

> * {
pointer-events: auto;
}
}

&__suffix {
Expand All @@ -90,6 +95,11 @@
right: calc(#{use-var(inline-padding-xs)} + 1px);
transform: translateY(-50%);
color: use-text-color(secondary);
pointer-events: none;

> * {
pointer-events: auto;
}
}

&.hasAddonBefore {
Expand Down
10 changes: 10 additions & 0 deletions src/theme/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,21 @@
&__icon-container {
display: block;
position: relative;
pointer-events: none !important;

.aui-icon {
margin: 0 !important;
}
}

&.isDisabled &__icon-container {
color: use-rgb(n-4);
}

&__indicator {
display: flex;
}

&__clear {
display: none;

Expand All @@ -205,6 +214,7 @@

&__clear {
display: flex;
pointer-events: auto;
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/tooltip/base-tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export class BaseTooltip<T = any>
this.renderer.listen(
this.elRef.nativeElement,
'click',
this.onClick.bind(this) as () => void,
this.onClick.bind(this),
),
);
break;
Expand Down Expand Up @@ -458,8 +458,9 @@ export class BaseTooltip<T = any>
}
}

protected onClick() {
protected onClick(event: Event) {
this.toggleTooltip();
event.stopPropagation();
}

protected onBodyClick(event: Event) {
Expand Down
6 changes: 6 additions & 0 deletions stories/select/basic.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { NgFor } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { SelectModule } from 'src/select';

@Component({
standalone: true,
imports: [SelectModule, FormsModule, NgFor],
selector: 'story-select-basic',
template: `
<aui-select
Expand Down
6 changes: 1 addition & 5 deletions stories/select/basic.stories.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';

import SelectBasicComponent from './basic.component';

import { IconModule, SelectModule } from '@alauda/ui';

const meta: Meta<SelectBasicComponent> = {
title: 'Example/Select',
component: SelectBasicComponent,
decorators: [
moduleMetadata({
declarations: [SelectBasicComponent],
imports: [FormsModule, SelectModule, IconModule, BrowserAnimationsModule],
imports: [BrowserAnimationsModule, SelectBasicComponent],
}),
],
};
Expand Down

0 comments on commit e2f61b3

Please sign in to comment.