Skip to content

Commit

Permalink
Merge branch 'master' into 4179_search-a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
asudoh authored Oct 10, 2019
2 parents 0ff8adf + 8c8a825 commit dd01ff9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/tag/_tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
}

.#{$prefix}--tag--filter:focus > svg {
border: 2px solid $inverse-01;
box-shadow: inset 0 0 0 2px $inverse-focus-ui;
border-radius: 50%;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import React, { Component } from 'react';
import classNames from 'classnames';
import flatpickr from 'flatpickr';
import l10n from 'flatpickr/dist/l10n/index';
import rangePlugin from 'flatpickr/dist/plugins/rangePlugin';
import { settings } from 'carbon-components';
import DatePickerInput from '../DatePickerInput';
import carbonFlatpickrFixEventsPlugin from './plugins/fixEventsPlugin';
import carbonFlatpickrRangePlugin from './plugins/rangePlugin';
import { match, keys } from '../../internal/keyboard';

const { prefix } = settings;
Expand Down Expand Up @@ -348,7 +348,7 @@ export default class DatePicker extends Component {
maxDate: maxDate,
plugins: [
datePickerType === 'range'
? new rangePlugin({ input: this.toInputField, position: 'left' })
? new carbonFlatpickrRangePlugin({ input: this.toInputField })
: () => {},
carbonFlatpickrMonthSelectPlugin({
selectorFlatpickrMonthYearContainer: '.flatpickr-current-month',
Expand Down
15 changes: 15 additions & 0 deletions packages/react/src/components/DatePicker/plugins/rangePlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import rangePlugin from 'flatpickr/dist/plugins/rangePlugin';

/**
* @param {object} config Plugin configuration.
* @returns {Plugin} An extension of Flatpickr `rangePlugin` that does the following:
* * Better ensures the calendar dropdown is always aligned to the `<input>` for the starting date.
* Workaround for: https://github.com/flatpickr/flatpickr/issues/1944
*/
export default config => {
const factory = rangePlugin(Object.assign({ position: 'left' }, config));
return fp =>
Object.assign(factory(fp), {
onPreCalendarPosition() {},
});
};

0 comments on commit dd01ff9

Please sign in to comment.