Comments (5)
Hi @bigmike36c, Thanks for reporting this issue. I agree with your comment about the behaviour and I have corrected that (will be released in 0.6.0).
Regarding your second issue, can you please briefly explain your process? How will you use it if single date selection were to trigger a callback.
from dash-mantine-components.
Thanks for correcting this so quickly!
In my mind, if a user only selects a single date, then the user expects the date range to extend from the start date to the maximum date available.
The code snippet below is essentially how I've been handling this with the default dcc.DatePickerRange. If the callback is triggered with only one date selected (either start or end), the other date is simply set to an empty string in the callback. I then convert the empty string to the minimum or maximum date in the dataframe.
start_date = start_date or df["datetime"].min()
end_date = end_date or df["datetime"].max()
Since the dmc.DateRangePicker only lets you select the start date on its own, I think it would make the most sense for the callback to receive ["selected_start_date", maxDate]. If the maxDate parameter was not set, it could be replaced with an empty string or None.
from dash-mantine-components.
Okay got it.
I can think about partial callback where in you at least get one date which is selected (keeping in mind backwards compatibility).
But I don't think we can do
callback to receive ["selected_start_date", maxDate].
It makes the date range picker less intuitive as to what's in the value is not what's displayed, etc.
from dash-mantine-components.
Makes sense to me. Could the callback just trigger with "selected_date"
as a string instead of a list? This would make it easy to handle both single date and range selections in the callback logic with the isinstance()
function.
from dash-mantine-components.
Ability to select single date won't be supported in dmc.DateRangePicker, for such purposes please use two date pickers.
from dash-mantine-components.
Related Issues (20)
- unable to set NumberInput to None from a callback HOT 3
- [BUG] dmc.Button fullWidth in dmc.MenuTarget
- TabIndex for Button
- Color picker swatches
- JsonInput formatOnBlur is always on
- Can't clear datepickerrange HOT 2
- Min value of RangeSlider is None
- Data Property does not get saved for a multi page setup
- SegmentedControl: Cannot read properties of null (reading 'getBoundingClientRect')
- Theme's primaryColor is ignored
- Menu hidden when overflow HOT 1
- [BUG] `Slider` and `RangeSlider` compressed to a point when `align=center` in a `dmc.Stack`.
- DatePicker Crashes with Scaled Screen Resolution HOT 1
- Carousel support [feature request] HOT 2
- Conda forge support
- [BUG] dmc.HoverCard blocked by other components when placed in a dmc.AccordionMultiple with style={'postion': ‘fixed’} set. HOT 9
- [Request] How can I change the checkedIcon displayed on the left of dmc.Chip?
- Add a focus attribute to the Textarea element
- Checkboxes in TransferList don't work if the values in the list aren't strings
- 'required' prop on select & multiselect not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash-mantine-components.