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

Accessibility - Teacher - Calendar - Font size on Edit Event screen #3061

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,27 @@ extension InstUI {
public var body: some View {
VStack(spacing: 0) {
HStack(spacing: InstUI.Styles.Padding.standard.rawValue) {
label
.textStyle(.cellLabel)

if date != nil {
datePicker
if dynamicTypeSize > .accessibility3 {
Copy link
Contributor

@rh12 rh12 Jan 24, 2025

Choose a reason for hiding this comment

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

This limit seems arbitrary to me, but not sure whether is there a proper way to check when would we extend the screen size.
What happens when we have the clear button?

Not sure this works here, but may worth to look into ViewThatFits.

If that fails, what do you think about another way, to add a geometry: GeometryProxy to DatePickerCell and add .frame(maxWidth: geometry.size.width) in there, in place of the .lineLimit(0).
It's less pretty but maybe less hacky as well. The label may disappear in certain conditions, so this is also not a perfect solution.
We could discuss it briefly with the others on Monday.

Please update the other screens which uses this cell as well (EditCalendarToDoScreen, EditCustomFrequencyScreen)

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should definitely check ViewThatFits since that's the way Apple proposes for such use cases.

VStack(alignment: .leading) {
label
.textStyle(.cellLabel)

if date != nil {
datePicker
} else {
placeholderButtons
}
}
} else {
placeholderButtons
label
.textStyle(.cellLabel)

if date != nil {
datePicker
} else {
placeholderButtons
}
}

if isClearable {
clearButton
}
Expand Down Expand Up @@ -105,7 +117,7 @@ extension InstUI {
in: validFrom...validUntil,
displayedComponents: components,
label: {}
)
).lineLimit(0)
}

private var components: DatePicker<Label>.Components {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct EditCalendarEventScreen: View, ScreenViewTrackable {
.id("details")
.focused($focusedInput, equals: .details)
}
.frame(maxWidth: geometry.size.width)
.animation(.default, value: viewModel.isAllDay)

// defocus inputs when otherwise non-tappable area is tapped
Expand Down