Skip to content

Commit

Permalink
fix: pass action trigger glyph to beforeContent to ensure underline o…
Browse files Browse the repository at this point in the history
…n hover only impacts text (#1349)
  • Loading branch information
chrisdholt authored Jan 31, 2019
1 parent 5fef862 commit ead4468
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ describe("action trigger", (): void => {
}).not.toThrow();
});

test("should throw if glyph prop is not provided", () => {
test("should not throw if glyph prop is not provided", () => {
expect(() => {
shallow(<MSFTActionTrigger glyph={null} />);
}).toThrow();
}).not.toThrow();
});

test("should create glyph element passed in", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class ActionTrigger extends Foundation<
ButtonAppearance[ActionTriggerAppearance[this.props.appearance]]
}
jssStyleSheet={actionTriggerButtonOverrides}
beforeContent={this.generateGlyph}
>
{this.props.glyph(get(this.props, "managedClasses.actionTrigger_glyph"))}
{this.props.children}
</Button>
);
Expand Down Expand Up @@ -92,6 +92,10 @@ class ActionTrigger extends Foundation<

return super.generateClassNames(classNames);
}

private generateGlyph = (): React.ReactNode => {
return this.props.glyph(get(this.props, "managedClasses.actionTrigger_glyph"));
};
}

export default ActionTrigger;
Expand Down

0 comments on commit ead4468

Please sign in to comment.