Skip to content

Commit

Permalink
refactor(datetime): remove unused isPresented variable (#27956)
Browse files Browse the repository at this point in the history
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. -->

`ion-datetime` has a state variable `isPresented`, which is never set
and goes unused except to add a CSS class (also unused).

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

State variable and class removed.

## 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. -->
  • Loading branch information
averyjohnston committed Aug 9, 2023
1 parent aa326a6 commit 07dee74
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export class Datetime implements ComponentInterface {

@Element() el!: HTMLIonDatetimeElement;

@State() isPresented = false;
@State() isTimePopoverOpen = false;

/**
Expand Down Expand Up @@ -2361,19 +2360,7 @@ export class Datetime implements ComponentInterface {
}

render() {
const {
name,
value,
disabled,
el,
color,
isPresented,
readonly,
showMonthAndYear,
preferWheel,
presentation,
size,
} = this;
const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size } = this;
const mode = getIonMode(this);
const isMonthAndYearPresentation =
presentation === 'year' || presentation === 'month' || presentation === 'month-year';
Expand All @@ -2393,7 +2380,6 @@ export class Datetime implements ComponentInterface {
class={{
...createColorClasses(color, {
[mode]: true,
['datetime-presented']: isPresented,
['datetime-readonly']: readonly,
['datetime-disabled']: disabled,
'show-month-and-year': shouldShowMonthAndYear,
Expand Down

0 comments on commit 07dee74

Please sign in to comment.