Skip to content

Commit

Permalink
changed variable name from myRef to elementRef
Browse files Browse the repository at this point in the history
  • Loading branch information
ambershand committed Sep 17, 2024
1 parent 78f55e5 commit 0a19d99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/bpk-component-datepicker/src/BpkDatepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ type State = {
class BpkDatepicker extends Component<Props, State> {
inputRef: (ref:HTMLInputElement) => void;

myRef?: HTMLInputElement;
elementRef?: HTMLInputElement;

divRef?: RefObject<HTMLInputElement>;

Expand Down Expand Up @@ -148,7 +148,7 @@ class BpkDatepicker extends Component<Props, State> {
};
this.divRef = createRef();
this.inputRef = (ref) => {
this.myRef = ref
this.elementRef = ref
}
}

Expand Down Expand Up @@ -278,9 +278,9 @@ class BpkDatepicker extends Component<Props, State> {
DateUtils.isSameDay(newEndDate, selectionConfiguration.startDate))
) {
onDateSelect(selectionConfiguration.startDate, newEndDate);
this.myRef && setNativeValue(this.myRef, this.props.formatDate(newEndDate));
this.elementRef && setNativeValue(this.elementRef, this.props.formatDate(newEndDate));
} else {
this.myRef && setNativeValue(this.myRef, this.props.formatDate(newStartDate));
this.elementRef && setNativeValue(this.elementRef, this.props.formatDate(newStartDate));
onDateSelect(newStartDate);
}
}
Expand Down

0 comments on commit 0a19d99

Please sign in to comment.