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

feat(picker): add inline picker #28689

Merged
merged 10 commits into from Dec 13, 2023
Merged

feat(picker): add inline picker #28689

merged 10 commits into from Dec 13, 2023

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Dec 11, 2023

Issue number: resolves #24905, resolves #26840, resolves #15710


What is the current behavior?

The current picker is only displayed as an overlay which makes it impossible to use inline with the rest of the application. Additionally, there are several bugs and missing features. For example, it is impossible to know when the value of the picker column has changed using public APIs. This is valuable for updating other columns in response to that data.

What is the new behavior?

  • Introduces ion-picker as an inline wheel picker component. The overlay picker is still available using ion-picker-legacy.
  • The implementation of this component resolves linked bugs. It also resolves linked features by exposing an ionChange event for developers to listen for.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev-build: 7.5.8-dev.11702398696.1ab62ea9

liamdebeasi and others added 7 commits November 28, 2023 12:47
BREAKING CHANGE: `ion-picker` and `ion-picker-column` have been renamed to `ion-picker-legacy` and `ion-picker-legacy-column`, respectively. This change was made to accommodate the new inline picker component while allowing developers to continue to use the legacy picker during this migration period.
Issue number: #

---------

<!-- 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. -->

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

-
-
-

## Does this introduce a breaking change?

- [ ] Yes
- [ ] No

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


## Other information

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Perkins <sean@ionic.io>
Co-authored-by: Éric Le Maître <eric.erwan.le.maitre@gmail.com>
Co-authored-by: Shawn Taylor <shawn@ionic.io>
Issue number: Internal

---------

<!-- 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. -->

The new picker component does not have a counterpart for the `prefix`
and `suffix` properties on the old picker column.

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

- `prefix` and `suffix` slots added.
- Picker items wrapped in a new `.picker-opts` element for positioning
purposes, similar to the legacy picker column. This necessitated
additional changes to functionality and styling, since previously the
items were direct descendants of the host.
- New `setFocus` method added. This gets around a browser bug in Firefox
where calling `focus()` on the column doesn't correctly move focus, as
the nearest focusable element (`.picker-opts`) is in the shadow DOM.

## 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. -->

While you can no longer call `focus()` on the column in Firefox and must
use `setFocus()` instead, this isn't considered a breaking change
because this component isn't public API yet.

## Other information

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

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Issue number: N/a

---------

<!-- 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. -->

The team would like to add a way of using the picker inline with page
content.

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

- This PR integrates the column option component with the rest of the
picker so that is functional. This PR is a combination of commits from
previously reviewed PRs.

## 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. -->


## Other information

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

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Issue number: N/A

---------

## What is the current behavior?
Picker has the following CSS variables for styling:
`--wheel-fade-background-rgb` and `--wheel-highlight-background`

These variables make sense when used from `ion-datetime`, but picker
does not need the `wheel` prefix.

## What is the new behavior?

### Datetime

- Adds `--wheel-highlight-border-radius` 
- Keeps `--wheel-fade-background-rgb` and `--wheel-highlight-background`
- Assigns these variables to picker's new variables

```scss
ion-picker {
  --highlight-background: var(--wheel-highlight-background);
  --highlight-border-radius: var(--wheel-highlight-border-radius);
  --fade-background-rgb: var(--wheel-fade-background-rgb);
}
```

### Picker 

Renames `--wheel-fade-background-rgb` and `--wheel-highlight-background`
and adds another CSS variables to `ion-picker`:

- Renames `--wheel-fade-background-rgb` to `--fade-background-rgb` 
- Renames `--wheel-highlight-background` to `--highlight-background`
- Adds `--highlight-border-radius`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

PR to update the [Datetime docs](ionic-team/ionic-docs#3303)

---------

Co-authored-by: ionitron <hi@ionicframework.com>
@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package package: react @ionic/react package labels Dec 11, 2023
@liamdebeasi liamdebeasi changed the title Fw 5575 feat(picker): add inline picker Dec 11, 2023
@liamdebeasi liamdebeasi marked this pull request as ready for review December 11, 2023 20:52
BREAKING.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: angular @ionic/angular package package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants