Skip to content

Commit dd3dc3f

Browse files
fix(skills): improve date range picker two-input guidance
1 parent d9462a7 commit dd3dc3f

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

skills/igniteui-angular-components/references/form-controls.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,23 @@ import { IgxIconComponent } from 'igniteui-angular/icon';
141141
</igx-date-range-picker>
142142
```
143143

144-
>[!NOTE]
145-
> `IgxDateRangePickerComponent` is imported from `igniteui-angular/date-picker`.
146-
> In the two-input configuration, place the `input` directly inside `igx-date-range-start` and `igx-date-range-end`.
147-
> To open the calendar from an icon, use `igx-picker-toggle`.
148-
> Do not wrap the inputs in an additional `igx-input-group`.
144+
145+
`IgxDateRangePickerComponent` is imported from `igniteui-angular/date-picker`.
146+
147+
In the two-input configuration:
148+
149+
- place the `input` directly inside `igx-date-range-start` and `igx-date-range-end`
150+
- use `igx-picker-toggle igxPrefix` for the calendar action
151+
- use `igx-picker-clear igxSuffix` for the clear action
152+
153+
A plain `igx-prefix` or `igx-suffix` with an `igx-icon` is decorative only and does not trigger picker actions.
154+
Do not wrap the inputs in an additional `igx-input-group`.
155+
156+
**Avoid these patterns in two-input mode:**
157+
158+
- `<igx-prefix><igx-icon>calendar_today</igx-icon></igx-prefix>`
159+
160+
- placing the toggle on only one input unless explicitly requested
149161

150162
Common two-input configuration with calendar toggles:
151163

@@ -155,13 +167,22 @@ Common two-input configuration with calendar toggles:
155167
<igx-picker-toggle igxPrefix>
156168
<igx-icon>calendar_today</igx-icon>
157169
</igx-picker-toggle>
170+
<label igxLabel>Start Date</label>
158171
<input igxInput igxDateTimeEditor type="text" />
172+
<igx-picker-clear igxSuffix>
173+
<igx-icon>clear</igx-icon>
174+
</igx-picker-clear>
159175
</igx-date-range-start>
176+
160177
<igx-date-range-end>
161178
<igx-picker-toggle igxPrefix>
162179
<igx-icon>calendar_today</igx-icon>
163180
</igx-picker-toggle>
181+
<label igxLabel>End Date</label>
164182
<input igxInput igxDateTimeEditor type="text" />
183+
<igx-picker-clear igxSuffix>
184+
<igx-icon>clear</igx-icon>
185+
</igx-picker-clear>
165186
</igx-date-range-end>
166187
</igx-date-range-picker>
167188
```
@@ -327,7 +348,8 @@ export class MyFormComponent {
327348
- **Always check `app.config.ts` first** — add `provideAnimations()` before using Combo, Select, Date Picker, or any overlay component
328349
- **Import from specific entry points** — avoid the root `igniteui-angular` barrel
329350
- Date/Time pickers implement both `ControlValueAccessor` and `Validator` — they integrate with reactive forms natively
330-
- For `igx-date-range-picker` with separate start and end inputs, place the inputs directly inside `igx-date-range-start` and `igx-date-range-end`. Use `igx-picker-toggle` if an icon should open the calendar.
351+
- For `igx-date-range-picker` with separate start and end inputs, use this structure for both inputs: `igx-picker-toggle igxPrefix`, then `input igxInput igxDateTimeEditor`, then optional `igx-picker-clear igxSuffix`.
352+
- Do not use a plain `igx-prefix` / `igx-suffix` icon for calendar or clear actions.
331353

332354
## See Also
333355

0 commit comments

Comments
 (0)