Skip to content

Conversation

J-Michalek
Copy link
Contributor

πŸ”— Linked issue

Resolves: #4718

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I added a new props showButtons that add the option to hide the buttons.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@J-Michalek
Copy link
Contributor Author

The wording in the docs could be improved and also I'm not sure about the prop name some alternatives would be hideButtons: boolean, buttons: boolean or perhaps integrate it into the increment and decrement props to allow false to be passed in and hide the button...

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 22, 2025

npm i https://pkg.pr.new/@nuxt/ui@4805

commit: ef6fcc2

@benjamincanac benjamincanac added the v3 #1289 label Aug 27, 2025
@J-Michalek J-Michalek changed the base branch from v3 to v4 October 13, 2025 04:46
@J-Michalek
Copy link
Contributor Author

@benjamincanac I've addressed #4805 (comment)

I am wondering if we could get rid of incrementDisabled and decrementDisabled props in favor of increment.disabled and decrement.disabled, what do you think?

@benjamincanac
Copy link
Member

I agree it would be better but this would cause a breaking change 😬

@J-Michalek J-Michalek changed the title feat(InputNumber): add showButtons prop feat(InputNumber): add option to hide increment/decrement buttons Oct 15, 2025
Comment on lines 114 to 124
}, {
orientation: 'vertical',
increment: false,
decrement: false,
class: 'pe-2.5'
}, {
orientation: 'horizontal',
increment: false,
decrement: false,
class: 'px-2.5 text-start'
}],
Copy link
Member

@benjamincanac benjamincanac Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect because it depends on the size, on horizontal orientation the padding should depend on increment / decrement for right and left independently. Do we really need to reset this padding? πŸ€”

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize it changes with each size 😬 I think we have to adjust it atleast for the horizontal orientation as it leaves this empty space to the left of the value. I was think that the number input without buttons should look the same as Input.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need to play with increment: false and decrement: false in the actual compoundVariants to not add the px-* or pe-* instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed the changes, Its kinda long and might be confusing tho, but I was able to achieve the same look for both orientations this way.
image
we could simplify it by removing this part d0b66d9#diff-6fe3c9038bd5faf484a683d874590e0f317c7027cca6f9d6451b7d67efb73b58R100-R124 , but then the inputs would have different widths:
image

d0b66d9

@benjamincanac benjamincanac marked this pull request as draft October 18, 2025 17:16
@benjamincanac benjamincanac removed the v3 #1289 label Oct 21, 2025
}, {
orientation: 'horizontal',
size: 'md',
decrement: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-Michalek If decrement is false but increment is true we still need some padding. We need to split those px-* into individual ps-* and pe-* I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[InputNumber] add option to hide increment/decrement buttons

2 participants