Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also copy fontWeight from inputStyle to hintNode #719

Closed
humphrey opened this issue May 31, 2022 · 2 comments
Closed

Also copy fontWeight from inputStyle to hintNode #719

humphrey opened this issue May 31, 2022 · 2 comments

Comments

@humphrey
Copy link

humphrey commented May 31, 2022

Great projects, thanks for maintaining it!

The Hint component does not copy the fontWeight styles from the input, so this can lead the hint not aligning correctly in some circumstances. Would it work to add fontWeight to the styles that are copied onto the Hint as per the following diff?

Here is the diff to version 5.2.0 that solved my problem:

diff --git a/node_modules/react-bootstrap-typeahead/es/components/Hint.js b/node_modules/react-bootstrap-typeahead/es/components/Hint.js
index 319c50c..bd90ba1 100644
--- a/node_modules/react-bootstrap-typeahead/es/components/Hint.js
+++ b/node_modules/react-bootstrap-typeahead/es/components/Hint.js
@@ -39,6 +39,7 @@ function copyStyles(inputNode, hintNode) {
   hintNode.style.borderStyle = interpolateStyle(inputStyle, 'border', 'style');
   hintNode.style.borderWidth = interpolateStyle(inputStyle, 'border', 'width');
   hintNode.style.fontSize = inputStyle.fontSize;
+  hintNode.style.fontWeight = inputStyle.fontWeight;
   hintNode.style.height = inputStyle.height;
   hintNode.style.lineHeight = inputStyle.lineHeight;
   hintNode.style.margin = interpolateStyle(inputStyle, 'margin');

This issue body was partially generated by patch-package.

ericgio added a commit that referenced this issue Jun 3, 2022
@ericgio
Copy link
Owner

ericgio commented Jun 3, 2022

Fixed in v6.0.0-rc.1

@ericgio ericgio closed this as completed Jun 3, 2022
@humphrey
Copy link
Author

humphrey commented Jun 4, 2022

Fixed in v6.0.0-rc.1

You're a legend! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants