Skip to content

Commit b0aa2cd

Browse files
committed
- BsTooltip: improve show/hide.
- Improve field label css
1 parent bd036c2 commit b0aa2cd

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

src/components/Basic/basic.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
height: 48px;
3939

4040
&.subheader--dark {
41-
--#{vars.$prefix}subheader-color: #{rgba(colors.$white, .8)};
41+
--#{vars.$prefix}subheader-color: #{rgba(colors.$white, .68)};
4242
}
4343

4444
&.subheader--light {

src/components/Field/field.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@
6565
}
6666
}
6767

68+
> .col-form-label, .#{vars.$prefix}field-label {
69+
color: var(--#{vars.$prefix}field-label-color);
70+
}
71+
6872
&.required {
69-
> .col-form-label,
70-
.#{vars.$prefix}field-label {
71-
color: var(--#{vars.$prefix}field-label-color);
73+
> .col-form-label, .#{vars.$prefix}field-label {
7274
font-weight: vars.$font-weight-semi-bold;
7375
}
7476
}

src/components/Tooltip/mixins/tooltipApi.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,22 @@ export function useAddTooltipListener(
213213
window.requestAnimationFrame(() => {
214214
useSetTooltipPosition(activatorRef, tooltipRef, tooltipArrowRef, placementRef);
215215
instance.emit('update:show', true);
216-
active.value = true;
216+
Helper.defer(() => {
217+
active.value = true;
218+
}, 60);
217219
});
218-
// preventEventTarget(e);
219220
};
220221
const hideTooltip = () => {
222+
Helper.defer(() => {
223+
active.value = false;
224+
}, 60);
221225
instance.emit('update:show', false);
222-
active.value = false;
223226
};
224227

225228
const activatorEl = findActivatorElement(instance, trigger) as IHTMLElement | null;
226229
activatorRef.value = activatorEl;
227230

228231
if (activatorEl) {
229-
// const options = { capture: true, passive: false };
230232
(activatorEl as IBindingElement).__mouseEvents = {
231233
mouseEnter: EventListener.listen(activatorEl, 'mouseenter', showTooltip),
232234
mouseLeave: EventListener.listen(activatorEl, 'mouseleave', hideTooltip),

src/mixins/types/DomHelper.d.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ export declare class EventListener {
55
* Listen to DOM events during the bubble phase.
66
*
77
* @param context DOM element to register listener on.
8-
* @param eventType Event type, e.g. 'click' or 'mouseover'.
8+
* @param eventName Event type, e.g. 'click' or 'mouseover'.
99
* @param callback Callback function.
1010
* @param options Listener options.
1111
* @returns Object with a `remove` method.
1212
*/
13-
static listen(context: IHTMLElement, eventType: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): IEventResult | undefined;
13+
static listen(
14+
context: IHTMLElement,
15+
eventName: string,
16+
callback: EventListenerOrEventListenerObject,
17+
options?: boolean | AddEventListenerOptions
18+
): IEventResult | undefined;
1419
}
1520

1621
export declare function useAddResizeListener(el: IBindingElement, fn: CallableFunction): void;
@@ -28,4 +33,7 @@ export declare function isSVGElement(source?: HTMLElement | null): boolean;
2833
* @param target The child element to check.
2934
* @returns TRUE if `target` is indirect child otherwise `false`.
3035
*/
31-
export declare function isChildOf(parent: HTMLElement | Node | null, target?: HTMLElement | null): boolean;
36+
export declare function isChildOf(
37+
parent: HTMLElement | Node | null,
38+
target?: HTMLElement | null
39+
): boolean;

0 commit comments

Comments
 (0)