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

Show missing required asterisk in BitDatePicker's label (#9862) #9880

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
id="@_inputId"
role="combobox"
tabindex="@TabIndex"
required="@Required"
aria-haspopup="dialog"
aria-label="@AriaLabel"
placeholder="@Placeholder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ protected override void RegisterCssClasses()
ClassBuilder.Register(() => Standalone ? "bit-dtp-sta" : string.Empty);

ClassBuilder.Register(() => _hasFocus ? $"bit-dtp-foc {Classes?.Focused}" : string.Empty);

ClassBuilder.Register(() => IsEnabled && Required ? "bit-dtp-req" : string.Empty);
}

protected override void RegisterCssStyles()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,13 @@
}
}

.bit-dtp-req {
.bit-dtp-lbl::after {
content: "*";
color: $clr-req;
margin-inline-start: spacing(0.625);
}
}

.bit-dtp-res {
@include lt-sm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<br /><br />
<BitDatePicker Label="Disabled" IsEnabled="false" />
<br /><br />
<BitDatePicker Label="Required" Required />
<br /><br />
<BitDatePicker Label="PlaceHolder" Placeholder="Select a date" />
<br /><br />
<BitDatePicker Label="Week numbers" ShowWeekNumbers />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ private void HandleInvalidSubmit()
private readonly string example1RazorCode = @"
<BitDatePicker Label=""Basic DatePicker"" />
<BitDatePicker Label=""Disabled"" IsEnabled=""false"" />
<BitDatePicker Label=""Required"" Required />
<BitDatePicker Label=""PlaceHolder"" Placeholder=""Select a date"" />
<BitDatePicker Label=""Week numbers"" ShowWeekNumbers />
<BitDatePicker Label=""Highlight months"" HighlightCurrentMonth HighlightSelectedMonth />
Expand Down
Loading