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

When instantiating Slider, value parameter is not automatically set to min parameter value, when value is not specified. #3503

Closed
1 task done
taaaf11 opened this issue Jun 20, 2024 · 0 comments · Fixed by #3507
Assignees
Labels
enhancement Improvement/Optimization

Comments

@taaaf11
Copy link
Contributor

taaaf11 commented Jun 20, 2024

Duplicate Check

Describe the bug

When instantiating Slider, if value parameter is not given, it raises AssertionError, as its value is None. It should be assigned the value of min parameter, which defaults to 0 if not given.

Code

import flet as ft


def main(page: ft.Page):
    page.add(ft.Slider(min=1, max=10)


ft.app(main)

To reproduce

  1. Run the repro code.

Expected behavior

It should set the value property to min property when value is not specified.

Screenshots

No response

Operating System

Windows

Operating system details

Windows 10 22H2

Flet version

Name: flet Version: 0.23.0 Summary: Flet for Python - easily build interactive multi-platform apps in Python Home-page: Author: Appveyor Systems Inc. Author-email: [email protected] License: Apache-2.0 Location: C:\Users\Altaaf\python-backend-projects\todo-app.venv\Lib\site-packages Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog Required-by:

Regression

I'm not sure / I don't know

Suggestions

No response

Additional details

No response

@ndonkoHenri ndonkoHenri self-assigned this Jun 20, 2024
@ndonkoHenri ndonkoHenri added the enhancement Improvement/Optimization label Jun 20, 2024
ndonkoHenri added a commit that referenced this issue Jun 21, 2024
@ndonkoHenri ndonkoHenri linked a pull request Jun 21, 2024 that will close this issue
@ndonkoHenri ndonkoHenri moved this from 🆕 New to 👀 In review in Flet Development Jun 21, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Flet Development Jun 24, 2024
zrr1999 pushed a commit to zrr1999/flet that referenced this issue Jul 17, 2024
* Fix flet-dev#3503: `Slider.value` defaults to `min`

* Fix flet-dev#3505: add "hide" and "show" to  WindowEventType enum

* Fix flet-dev#3499: TypeError raised for isinstance check with Union in before_update method

- Corrected isinstance check in SnackBar.before_update to use a tuple of types instead of Union, resolving TypeError: "Subscripted generics cannot be used with class and instance checks".

* Fix `Page.open()` breaking after multiple calls

* Fix flet-dev#3516: delete Page.window.on_resize | deprecate Page.on_resize in favor of Page.on_resized

* Page: Typo in on_resized setter decorator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement/Optimization
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants