Skip to content

Commit

Permalink
feat(date-textbox): added floating-ui support (#2529)
Browse files Browse the repository at this point in the history
  • Loading branch information
agliga authored Jan 17, 2025
1 parent 4265bed commit 5a5a45f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-bugs-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/skin": major
---

feat(floating-ui): added support in date-textbox
1 change: 1 addition & 0 deletions dist/date-textbox/date-textbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
}
.date-textbox {
--calendar-month-width: 311px;
display: inline-block;
}

.date-textbox > .textbox + .textbox {
Expand Down
3 changes: 0 additions & 3 deletions src/routes/_index/component/date-textbox/+page.marko
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
class="icon-btn icon-btn--transparent"
type="button"
aria-label="Calendar"
onclick="this.parentElement.nextElementSibling.toggleAttribute('hidden')"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -420,7 +419,6 @@
class="icon-btn icon-btn--transparent"
type="button"
aria-label="Calendar"
onclick="this.parentElement.nextElementSibling.toggleAttribute('hidden')"
disabled
>
<svg
Expand Down Expand Up @@ -485,7 +483,6 @@
class="icon-btn icon-btn--transparent"
type="button"
aria-label="Calendar"
onclick="this.parentElement.nextElementSibling.toggleAttribute('hidden')"
>
<svg
aria-hidden="true"
Expand Down
17 changes: 17 additions & 0 deletions src/routes/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,23 @@ document.querySelectorAll(".expand-btn").forEach(function (el) {
});
});

document.querySelectorAll(".date-textbox").forEach(function (el) {
const popperDropdown = new PopperDropdown(
el,
null,
".date-textbox__popover",
);

el.querySelector("button").addEventListener("click", function () {
this.parentElement.nextElementSibling.toggleAttribute("hidden");
if (this.parentElement.nextElementSibling.hasAttribute("hidden")) {
popperDropdown.hide();
} else {
popperDropdown.show();
}
});
});

document.querySelectorAll(".filter-menu-button--form").forEach(function (el) {
const popperDropdown = new PopperDropdown(
el,
Expand Down
2 changes: 2 additions & 0 deletions src/sass/date-textbox/date-textbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.date-textbox {
/* 343px - (2 * var(--spacing-200)) [not autmatically compiled by LESS] */
--calendar-month-width: 311px;

display: inline-block;
}

.date-textbox > .textbox + .textbox {
Expand Down

0 comments on commit 5a5a45f

Please sign in to comment.