Commit Graph

566 Commits

Author SHA1 Message Date
Sean Perkins
30b548b167 fix(many): dynamic label support for modern form controls (#27156)
<!-- Please refer to our contributing documentation for any questions on
submitting a pull request, or let us know here if you need any help:
https://ionicframework.com/docs/building/contributing -->

<!-- Some docs updates need to be made in the `ionic-docs` repo, in a
separate PR. See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#modifying-documentation
for details. -->

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Developers that are using Ionic v7 are experiencing an issue where
implementations that are intended to use the modern control syntax will
render with the legacy syntax and a warning will be displayed.

The issue is most easily reproduced by not assigning a label to the
control and then asynchronously assigning a label after a duration.

Angular example:
```html
<ion-item>
  <ion-input [label]="label"></ion-input>
</ion-item>
```

```ts
@Component({ ... })
export class MyComponent {
  @Input() label?: string; // initially unset

  ngOnInit() {
    setTimeout(() => this.label = 'Hello world', 500);
  }
}
```

<!-- Issues are required for both bug fixes and features. -->
Issue URL: resolves #27085


## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Form controls that do not have a decorative label or
`aria-label`/`aria-labelledby` assigned, will default render as modern
controls.
- Legacy form implementations that render an `<ion-label>` within the
item, will continue to render with the legacy template and a warning
will be displayed in the console.
- Modern form syntax supports dynamically set labels

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->

Legacy implementations that do not have a decorative label and do not
specify `aria-label` on the control, will be upgraded to the modern
syntax.

For example:
```html
<ion-item>
  <ion-input></ion-input>
</ion-item>
```

Developers that do not want to update to the modern syntax yet should
add the `legacy="true"` attribute to their form control.

## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev-build: `7.0.2-dev.11681157690.1060bc7f`

When migrating the range tests to modern syntax, I observed a visual
clipping issue. This is being addressed in:
https://github.com/ionic-team/ionic-framework/pull/27188. This PR simply
adds the legacy flag so that screenshots are the same as `main`.
2023-04-17 20:30:19 +00:00
Liam DeBeasi
5c0ead37bf docs(config): update innerHTML comments (#27032) 2023-03-27 15:14:02 -04:00
Liam DeBeasi
b7e46038e0 fix(many): innerHTML is disabled by default (#27029)
BREAKING CHANGE:

The `innerHTMLTemplatesEnabled` Ionic Config now defaults to `false`. Developers can set this option to `true` if they would like to continue to use custom HTML features in `ion-alert`, `ion-infinite-scroll-content`, `ion-loading`, `ion-refresher-content`, and `ion-toast`.
2023-03-27 12:07:00 -04:00
Liam DeBeasi
eb10a2e5f6 chore(): sync with main 2023-03-24 14:37:39 -04:00
Liam DeBeasi
3b0af7c55d feat(config): add option to disable custom html functionality (#26956) 2023-03-22 13:59:59 -04:00
Liam DeBeasi
708ccbf808 chore(): sync with main 2023-03-01 11:22:56 -05:00
Liam DeBeasi
8d1d0fa0c7 fix(overlays): focus trap refs cleared on dismiss (#26855) 2023-02-27 12:16:26 -05:00
Liam DeBeasi
fcfdd9e9ba fix(form): shadow components using aria-labelledby do not use modern syntax (#26836)
resolves #26829
2023-02-22 16:05:31 -05:00
Liam DeBeasi
eefd17d492 fix(scroll-padding): correct padding is added (#26810)
resolves #26803
2023-02-22 15:29:07 -05:00
Liam DeBeasi
2fd13610c4 test(overlays): skip flaky test (#26843) 2023-02-22 11:30:13 -05:00
Liam DeBeasi
799871e95d chore(): sync with main 2023-02-22 10:00:56 -05:00
Liam DeBeasi
5af0b8c914 test(scroll-assist): skip flaky test (#26835) 2023-02-21 12:26:23 -05:00
Sean Perkins
7578aa3c59 fix(select): emit single ionChange event for popover option selection (#26796)
Resolves #26789
2023-02-20 20:20:32 -05:00
Liam DeBeasi
5e41391ed2 fix(sanitizer): improve reliability of sanitizer (#26820) 2023-02-17 15:28:01 -05:00
Liam DeBeasi
3a64de49db fix(swipe-back): gesture rtl setting is reactive (#26795)
resolves #26794
2023-02-16 14:41:09 -05:00
Joe Woodhouse
fef634f7f0 fix(hide-caret): blur listener correctly removed (#26808)
resolves #26807
2023-02-16 12:49:53 -05:00
Liam DeBeasi
68e8379fb8 chore(): sync with main 2023-02-15 10:17:17 -05:00
Liam DeBeasi
180ee63ff7 fix(form): legacy deprecation is logged correctly (#26784) 2023-02-13 14:53:06 -05:00
Liam DeBeasi
3717dc452c test(tap-click): skip flaky test (#26776) 2023-02-13 11:46:59 -05:00
Liam DeBeasi
32de88eca5 test(scroll-assist): mark test as slow (#26777) 2023-02-13 10:48:03 -05:00
Liam DeBeasi
1eea054c12 fix(many): resolve import errors with stencil apps (#26781)
resolves #26778
2023-02-13 08:59:21 -05:00
Liam DeBeasi
21c0806bbd fix(tap-click): instant activate does not use a setTimeout (#26748) 2023-02-09 09:09:51 -05:00
Liam DeBeasi
4cff442c4f perf(gesture): reduce delay with adding and removing activated states (#26741)
resolves #23691
2023-02-07 16:35:19 -05:00
Sean Perkins
e028d13a1b chore(many): import types from source path (#26718) 2023-02-02 11:40:51 -05:00
Liam DeBeasi
1a8bd6d8c6 chore(deps): update to stencil v3 (#26663) 2023-01-31 18:07:22 -05:00
Liam DeBeasi
63f8525284 fix(many): legacy form control does not warn when using aria-labelledby (#26699)
resolves #26698
2023-01-30 16:02:00 -05:00
Liam DeBeasi
b78b454e08 revert(): revert base components feature (#26692)
The Ionic Framework team would like to re-evaluate our approach to improving customization options when building mobile applications. We are looking at other solutions that a) make customizing an app UI easier and b) are applicable to a broader set of developers.
2023-01-30 11:52:36 -05:00
Liam DeBeasi
fc561e37ef chore(): sync with main 2023-01-27 14:52:52 -05:00
Amanda Johnston
63afc279e5 test(overlays): re-enable hidden focusable element test (#26685) 2023-01-27 09:04:07 -06:00
Liam DeBeasi
18f109c7da feat(base-components): add ability to remove ios and md theme (#26669) 2023-01-24 16:18:35 -05:00
Liam DeBeasi
e8fb9e7328 chore(): sync with main 2023-01-23 13:38:16 -05:00
Liam DeBeasi
a7c2c555f3 fix(overlays): triggerController warns about missing triggers (#26651) 2023-01-23 12:59:00 -05:00
Liam DeBeasi
c01600191e chore(): sync with main 2023-01-18 09:36:43 -05:00
Sean Perkins
9761b0a092 feat(radio): component can be used outside of ion-item (#26582) 2023-01-10 21:19:21 -05:00
Amanda Johnston
c2e1ad385d chore(many): replace any types and add tech debt tickets (#26293)
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-01-06 09:34:55 -06:00
Amanda Johnston
9d52e70361 feat(checkbox): component can be used outside ion-item (#26518) 2023-01-05 13:49:04 -06:00
Liam DeBeasi
4515f03656 Merge remote-tracking branch 'origin/main' into sync-7-1-4-23 2023-01-04 10:20:44 -05:00
Liam DeBeasi
1e9cf12a74 test(many): skip additional flaky tests (#26523) 2023-01-04 10:19:48 -05:00
Liam DeBeasi
49baad8ee6 feat(range): component can be used outside of ion-item (#26479) 2022-12-15 15:52:56 -05:00
Liam DeBeasi
f9c681331c chore(): sync with main 2022-12-14 16:49:32 -05:00
Liam DeBeasi
b0fee77f94 test(animation): skip group css animation test (#26478) 2022-12-13 16:59:04 -05:00
Liam DeBeasi
8fff65cb66 chore(forms): add revision legacy form detection (#26477) 2022-12-13 16:32:33 -05:00
Liam DeBeasi
88e7ee985d chore(): sync with main 2022-12-09 12:37:06 -05:00
Liam DeBeasi
a99401bf0a test(overlays): remove broken test (#26457) 2022-12-09 11:11:42 -05:00
Liam DeBeasi
493e783b31 test(many): fix more flaky tests (#26450) 2022-12-08 17:56:43 -05:00
Liam DeBeasi
7ba2b65b54 test(config): tests now fail fast (#26447) 2022-12-08 16:25:50 -05:00
Liam DeBeasi
b18a193684 chore(): sync with main 2022-12-08 12:39:38 -05:00
Amanda Johnston
a67a827fed feat(toast): add global config toastDuration (#26425)
Co-authored-by: DwieDima <DwieDima@users.noreply.github.com>
2022-12-06 09:52:52 -06:00
Liam DeBeasi
1278a292f3 feat(input, toggle): add escape hatch property (#26416) 2022-12-05 13:43:07 -05:00
Sean Perkins
acb12b36ee Merge remote-tracking branch 'origin/main' into chore/sync-7.0-with-main-12-05-22 2022-12-05 11:25:10 -05:00