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(slider): resolve parity issue two handle feature #18394

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(slider): conflict resolve in storybook
  • Loading branch information
sangeethababu9223 committed Jan 7, 2025
commit c143d6e1d65f20d2c8c75f8aa0a1ebb3d8a66aa3
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class CDSSliderInput extends FocusMixin(LitElement) {
* Handles `change` event to fire a normalized custom event.
*/
private _handleChange({ target }: Event) {
console.log('here 1');

this.dispatchEvent(
new CustomEvent((this.constructor as typeof CDSSliderInput).eventChange, {
bubbles: true,
Expand All @@ -60,6 +62,8 @@ class CDSSliderInput extends FocusMixin(LitElement) {
* Handles `input` event to fire a normalized custom event.
*/
private _handleInput({ target }: Event) {
console.log('here 2');

this.dispatchEvent(
new CustomEvent((this.constructor as typeof CDSSliderInput).eventChange, {
bubbles: true,
Expand Down Expand Up @@ -164,6 +168,8 @@ class CDSSliderInput extends FocusMixin(LitElement) {
_handleChange: handleChange,
_handleInput: handleInput,
} = this;
console.log('here mainxss');
console.log('value', value);

const classes = classMap({
[`${prefix}--text-input`]: true,
Expand All @@ -179,7 +185,6 @@ class CDSSliderInput extends FocusMixin(LitElement) {
const warnIcon = WarningAltFilled16({
class: `${prefix}--slider__invalid-icon ${prefix}--slider__invalid-icon--warning`,
});

return html`
<input
?disabled="${disabled}"
Expand Down
23 changes: 23 additions & 0 deletions packages/web-components/src/components/slider/slider.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,29 @@ export const WithLayer = {
},
};

export const TwoHandleSlider = () => {
return html`
<cds-form-item>
<cds-slider
label-text="Slider Label"
max="100"
min="0"
step="1"
value="50"
value-upper="90">
<cds-slider-input
aria-label="Slider value"
type="number"
id="lower"></cds-slider-input>
<cds-slider-input
aria-label="Slider Upper value"
type="number"
id="upper"></cds-slider-input>
</cds-slider>
</cds-form-item>
`;
};

export const Skeleton = {
parameters: {
percy: {
Expand Down
Loading