Skip to content

Conversation

WillyJL
Copy link
Contributor

@WillyJL WillyJL commented Aug 14, 2024

What's new

  • I really liked the idea of a number input and already had a use for it, but found a detail that did not fit my use case:
    When showing NumberInput, there is always a number there
    You can set current number to 0, but then if you want to have a minimum value, current number is changed to minimum value, so user gets default text of the minimum value and they need to erase this then input their number
    My use case would work better where you can start typing, and the save button is enabled when the number is within bounds
  • This PR allows passing 0 as current number, which will mean the input is empty by default
  • Also, manually pressing 0 when input is empty shows the number 0 instead of doing nothing, to avoid confusion
  • Also aligned the input bar to keyboard bar, it was probably misaligned due to taking the skeleton of ByteInput, which has arrows on sides of input bar

Verification

  • Using example_number_input app:
    • Set number to zero
    • Click change again, input is empty due to current number being 0
    • Click 0 when input is empty, 0 is displayed
    • Check that input bar is vertically aligned to keyboard buttons

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@hedger hedger added the UI Affects UI label Aug 14, 2024
@skotopes
Copy link
Contributor

skotopes commented Sep 5, 2024

image

got some side effects when you set max to INT_MIN and then input number.

@skotopes skotopes marked this pull request as draft September 5, 2024 17:27
@skotopes
Copy link
Contributor

@Willy-JL do you need help with this one?

kbembedded added a commit to kbembedded/Flipper-Zero-Game-Boy-Pokemon-Trading that referenced this pull request Aug 8, 2025
This has an issue where it won't accept 0 as an input when min
is set to 0.

This PR flipperdevices/flipperzero-firmware#3840
sounds like it might address it, but, I'll look in to that another day.

Signed-off-by: Kris Bahnsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI Affects UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants