iOS compact style needs a width, is stuck left aligned
See original GitHub issueI’m trying to use the new compact date picker style in iOS but I’n having a hard time styling it.
When I first put it in I got the following:
<DateTimePicker
display="compact"
mode="date"
value={DateTime.local().toJSDate()}
/>
The date picker is the gray square on the right. I tried to set flex: 1
but that didn’t get things to display. Next I just set a width:
<DateTimePicker
style={{width: 140}}
display="compact"
mode="date"
value={DateTime.local().toJSDate()}
/>
Now I can see the date picker, but it’s too far to the left. I’d like to right align it. At this point I got stuck. Nothing I seemed to do right aligns the picker and because I don’t know the width (which is variable based on the contents).
Anyone run into this yet? any ideas?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:40
- Comments:8 (3 by maintainers)
Top Results From Across the Web
css - Website Stuck in Left Alignment on iPad - Stack Overflow
1) Align center in body (You didn't do this) ... 3) specify width in container. 4) align left in container to undo center...
Read more >SwiftUI Text Alignment Issue with Date and WidgetKit
When I preview this code in a traditional SwiftUI view, the code appears as expected; in the middle of the canvas (as there...
Read more >How to Align and Float Images with CSS | Web Design
The following sections will explain how to float and align images using CSS. Left, Center, and Right Align. Images can be aligned left,...
Read more >position - CSS: Cascading Style Sheets - MDN Web Docs
The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final ......
Read more >columns - CSS-Tricks
Using both column-count and column-width is recommended to create a flexible multi-column layout. The column-count will act as the maximum ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While we wait for a more permanent fix, my dirty workaround ended up looking something like this:
A year has passed, any updates on this issue?