Skip to content

Commit ea0c7d5

Browse files
d13saeedzaha
authored andcommitted
Fixes graph errors
1 parent b5a7886 commit ea0c7d5

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

src/webviews/apps/plus/graph-next/graph-header.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,8 @@ export class GlGraphHeader extends SignalWatcher(LitElement) {
785785
<code-icon icon="rocket"></code-icon>
786786
</a>
787787
<span slot="content">
788-
<span style="white-space: break-spaces">
789-
<strong>Launchpad</strong> &mdash; organizes your pull requests into actionable groups
790-
to help you focus and keep your team unblocked
791-
</span>
788+
<strong>Launchpad</strong> &mdash; organizes your pull requests into actionable groups to
789+
help you focus and keep your team unblocked
792790
</span>
793791
</gl-tooltip>
794792
<gl-tooltip placement="bottom">

src/webviews/apps/plus/graph-next/graph-wrapper/graph-wrapper.react.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ export function GraphWrapperReact(props: Readonly<GraphWrapperEvents & GraphWrap
516516
}
517517
onGraphRowUnhovered={(e, graphZoneType, graphRow) =>
518518
props.onGraphRowUnhovered?.({
519-
relatedTarget: e.relatedTarget,
519+
relatedTarget: e.nativeEvent.relatedTarget ?? e.relatedTarget,
520520
graphRow: graphRow,
521521
graphZoneType: graphZoneType,
522522
})

src/webviews/apps/shared/components/button.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,26 +211,38 @@ export class GlButton extends LitElement {
211211
@property()
212212
href?: string;
213213

214-
@property({ reflect: true })
215-
// eslint-disable-next-line lit/no-native-attributes
216-
override get role(): 'link' | 'button' {
217-
return this.href ? 'link' : 'button';
218-
}
219-
220214
@property()
221215
tooltip?: string;
222216

223217
@property()
224218
tooltipPlacement?: GlTooltip['placement'] = 'bottom';
225219

226-
protected override updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
227-
super.updated(changedProperties);
220+
override connectedCallback(): void {
221+
super.connectedCallback();
228222

229-
if (changedProperties.has('disabled')) {
223+
this.setAttribute('role', this.href ? 'link' : 'button');
224+
if (this.disabled) {
230225
this.setAttribute('aria-disabled', this.disabled.toString());
231226
}
232227
}
233228

229+
protected override willUpdate(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
230+
if (changedProperties.has('href')) {
231+
this.setAttribute('role', this.href ? 'link' : 'button');
232+
}
233+
234+
if (changedProperties.has('disabled')) {
235+
const disabled = changedProperties.get('disabled');
236+
if (disabled) {
237+
this.setAttribute('aria-disabled', disabled.toString());
238+
} else {
239+
this.removeAttribute('aria-disabled');
240+
}
241+
}
242+
243+
super.willUpdate(changedProperties);
244+
}
245+
234246
protected override render(): unknown {
235247
if (this.tooltip) {
236248
return html`<gl-tooltip .content=${this.tooltip} placement=${ifDefined(this.tooltipPlacement)}

0 commit comments

Comments
 (0)