Skip to content

Commit

Permalink
Merge pull request #75 from certego/develop
Browse files Browse the repository at this point in the history
v0.1.12
  • Loading branch information
drosetti authored Feb 13, 2024
2 parents 0c7b784 + e8262f0 commit 77d92be
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

**[Get it on npm](https://www.npmjs.com/package/certego-ui)**

## [v0.1.12](https://github.com/certego/certego-ui/releases/tag/v0.1.12)
Fixed auto-update DataTable when removed a filter with the cross icon

## [v0.1.11](https://github.com/certego/certego-ui/releases/tag/v0.1.11)
Removed debounce filter for columns

Expand Down
2 changes: 1 addition & 1 deletion example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/src/layouts/AppFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FaTwitter } from "react-icons/fa";
import { Toaster, ScrollToTopButton, useToastr } from "@certego/certego-ui";

// constants
const CERTEGO_UI_VERSION = "v0.1.11";
const CERTEGO_UI_VERSION = "v0.1.12";
const selector = (state) => state.toasts;

function AppFooter() {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@certego/certego-ui",
"version": "0.1.11",
"version": "0.1.12",
"description": "certego components library (react.js, reactstrap, etc)",
"author": "certego",
"license": "MIT",
Expand Down
11 changes: 9 additions & 2 deletions src/components/table/filters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ function DefaultColumnFilter({ column: { filterValue, setFilter, id } }) {
"input-dark"
)}
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onChange={(e) => {
setInputValue(e.target.value);
// if the user clears the filter
if(e.target.value.length === 0) {
// Set undefined to remove the filter entirely
setFilter(undefined);
}
}}
onKeyDown={(e) => {
// the request is sent if the user presses 'enter'
if (e.key === "Enter") {
Expand All @@ -33,7 +40,7 @@ function DefaultColumnFilter({ column: { filterValue, setFilter, id } }) {
onKeyUp={(e) => {
// if the user presses 'backspace'
// the request is sent if input value is empty
if (e.key === "Backspace" && e.target.value === "") {
if (e.key === "Backspace" && e.target.value.length === 0) {
// Set undefined to remove the filter entirely
setFilter(undefined);
}
Expand Down

0 comments on commit 77d92be

Please sign in to comment.