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

Updates input width in _chips.scss sass component #513

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

Git-Harshit
Copy link

This is a minor but suitable change which updates the width property of an input field for adding new chips from fixed 120px to fit-content, with same !important weight. Also, the min-width and max-width properties are set to limit its size between 100px and 200px. With this change, the input placeholder (if limited to under 200px) will not get cropped, and it will also have a better fit into the input field, thereby offering it more flexibility to adapt the content.

Note: It was proposed long back into the parent repository Dogfalo#6567, where it went approved but unattended. Today, after a few years, as I had noted that this forked repository from the parent repository is the one under the latest maintenance, I had squashed and cherry-picked my previous changes from Dogfalo#6567 into another branch that was baselined with the v2-dev here, to raise another pull request for this same enhancement.

Proposed changes

This change fixes the issue that I had encountered recently with the placeholder or text of the input before pressing enter to convert it to a chip. Please have a look at how this small change affects the chips input (Screenshot from Google Chrome).
I did not file any bug for it since it was a working feature which gets enhanced with the SASS changes from this Pull Request.

Screenshots (if appropriate) or codepen:

Capture-ChangePropose

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist:

  • I have read the CONTRIBUTING document.
  • My commit messages follows the conventional commit format
  • My change requires a change to the documentation, and updated it accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This is a minor commit which updates the width of input field from fixed
121px to 'fit-content' type, overwritten wherever the browser is able to
render this property. Also, the optional min-width and max-width are set
to limit its size between a reasnable limit of 100px and 200px. With
this change, the input placeholder (if limited to under 200px) will not
get cropped, and it will also have a better fit into the input field.

Signed-off-by: Harshit Gupta <[email protected]>
@wuda-io
Copy link
Member

wuda-io commented Nov 6, 2024

I don't know if we really need the min- and max-width limits. Nevertheless, lets merge! Thanks.

@wuda-io wuda-io merged commit 7c17092 into materializecss:v2-dev Nov 6, 2024
@Git-Harshit
Copy link
Author

Hi @wuda-io,
This was a proposed fix for fitting the input fields width better with the placeholder used, trying to match it with fit-content CSS width property within the min and max width bounds on supported browsers by overriding the original 100px width.
Thanks for your approval review (it was also approved long back at Dogfalo#6567 in the original repo., which went inactive) and merging it.

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