Skip to content

Conversation

@rosskhanas
Copy link

@rosskhanas rosskhanas commented Feb 6, 2021

This change makes it possible to set font-weight by setting it in the input style.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2021

⚠️ No Changeset found

Latest commit: 04ae155

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 04ae155:

Sandbox Source
react-codesandboxer-example Configuration

@ebonow
Copy link
Collaborator

ebonow commented Feb 6, 2021

I'm not entirely sure this would be a desirable behavior. It's often that a container may have font-weight bold to apply to text nodes, where as an input seems a bit more explicit.

Please note that this is entirely possible already via the styles api though the input needs to be nested to apply to the actual input.

const styles = {
  valueContainer: (css) => ({ ...css, fontWeight: "bold" }),
  input: (css) => ({ 
    ...css, 
    'input': { 
      fontWeight: "inherit" 
     } 
  })
};

const App = (props) => {
  return <Select styles={styles} {...otherProps} />;
};

Demo: codesandbox

It's worth noting that this actually highlights another issue in that the autoSizeInput does not seem to have a means to apply changes to the styling when there are changes to the styles. It seems reasonable to expect react-select to be responsible for watching changes to the input style and apply them to the autosizeinput. This is highlighted here: #3835

@rosskhanas rosskhanas closed this May 5, 2021
@ebonow ebonow mentioned this pull request Jun 4, 2021
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

Successfully merging this pull request may close these issues.

2 participants