Repository: ionic-team/ionic-framework
File: core/src/components/button/button.tsx (TypeScript)

Code before:
      if (el instanceof HTMLFormElement) {
        return el;
      }
    }
    return null;
  }

  private handleClick = (ev: Event) => {
    const { el } = this;
    if (this.type === 'button') {
      openURL(this.href, ev, this.routerDirection, this.routerAnimation);
    } else if (hasShadowDom(el)) {
      // this button wants to specifically submit a form
      // climb up the dom to see if we're in a <form>
      // and if so, then use JS to submit it
      let formEl = this.findForm();
      const { form } = this;

      if (!formEl && form !== undefined) {
        /**
         * The developer specified a form selector for
         * the button to submit, but it was not found.
         */
        if (typeof form === 'string') {
          printIonWarning(
            `Form with selector: "#${form}" could not be found. Verify that the selector is correct and the form is rendered in the DOM.`,
            el
          );
        } else {
          printIonWarning(
            `The provided "form" element could not be found. Verify that the form is rendered in the DOM.`,
            el
          );
        }
        return;
      }

      if (!formEl) {
        /**
         * If the form element is not set, the button may be inside
         * of a form element. Query the closest form element to the button.
         */
        formEl = el.closest('form');
      }

      if (formEl) {
        ev.preventDefault();

        const fakeButton = document.createElement('button');
        fakeButton.type = this.type;
        fakeButton.style.display = 'none';

Review comment (suggestion):
```suggestion
            `Form with selector: "#${form}" could not be found. Verify that the ID is correct and the form is rendered in the DOM.`,
```
Nitpick, but this warning makes it sound like the `form` property is supposed to be a selector, rather than an ID, which may lead devs to think the fix is to add the `#` or that they can use other selectors like class names.

Code after:
      if (el instanceof HTMLFormElement) {
        return el;
      }
    }
    return null;
  }

  private handleClick = (ev: Event) => {
    const { el } = this;
    if (this.type === 'button') {
      openURL(this.href, ev, this.routerDirection, this.routerAnimation);
    } else if (hasShadowDom(el)) {
      // this button wants to specifically submit a form
      // climb up the dom to see if we're in a <form>
      // and if so, then use JS to submit it
      let formEl = this.findForm();
      const { form } = this;

      if (!formEl && form !== undefined) {
        /**
         * The developer specified a form selector for
         * the button to submit, but it was not found.
         */
        if (typeof form === 'string') {
          printIonWarning(
            `Form with selector: "#${form}" could not be found. Verify that the id is correct and the form is rendered in the DOM.`,
            el
          );
        } else {
          printIonWarning(
            `The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.`,
            el
          );
        }
        return;
      }

      if (!formEl) {
        /**
         * If the form element is not set, the button may be inside
         * of a form element. Query the closest form element to the button.
         */
        formEl = el.closest('form');
      }

      if (formEl) {
        ev.preventDefault();

        const fakeButton = document.createElement('button');
        fakeButton.type = this.type;
        fakeButton.style.display = 'none';