Skip to content

Also copy fontWeight from inputStyle to hintNode #719

@humphrey

Description

@humphrey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions