React Tabulator - custom header filter for select column - hide 'X' option

Is it possible to remove the 'x' option on header filters in react tabulator columns?

The issue arises when users click the 'X' to clear a filter, as expected. However, if they then try to click on the same filter for another list item, the list fails to load.

If users simply click on the list items without using the 'X', everything works fine.
Column:

{
    title: 'Column',
    field: 'Column',
    headerFilter: 'select',
    headerFilterParams: {
                values: true,
                sortValuesList: 'asc',
                },
            width: 125,
}

I have tried including CSS code to remove the delete option for all input search types on the overall page, but I am specifically interested in changing it for a specific header only.

`input[type='search']::-ms-clear {
display: none; width: 0; height: 0; }
input[type='search']::-ms-reveal {
display: none; width: 0; height: 0; }

input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
display: none;`

I have also attempted to use the built-in titleFormatter with Tabulator, but so far I have not been able to get it working properly.

Answer №1

This issue could potentially be a bug in Tabulator. I have found a workaround by utilizing the blur function.

Tabulator.extendModule("edit", "editors", {
  select: function (cell, onRendered, success, cancel, options) {
    let inputElement = SelectEditor.call(
        this,
        cell,
        onRendered,
        success,
        cancel,
        options
    );
  
    let listener = function (event) {
    inputElement.blur();
  };

  inputElement.addEventListener("search", listener);
  return inputElement;
}
});

Check out my CodeSandBox example

You can also submit a report about this issue on Tabulator's Github page.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with the Ajax auto-complete feature in Internet Explorer

I am facing an issue with my "ajax suggestion list" getting hidden behind the "select menu" located right below the text box that triggers the ajax function. This problem only occurs in IE 6.0, while it works fine in other browsers. I have already disabled ...

New to CSS/Ruby - What causes two adjacent buttons to have varying sizes?

The varying sizes of my search and login buttons located beside each other are puzzling me. Could it be due to the fact that the search button is enclosed within a submit_tag argument while the login button is not? If this is indeed the case, how can I mak ...

Implement a single CSS menu across various HTML pages

I'm currently working on developing a website. All of my pages have a common menu bar that I would like to include from a separate HTML file. Is there a way to include HTML files in order to address this concern? If so, what is the syntax for imple ...

What is the best way to combine two buttons into a single button?

I have a dilemma with merging two buttons into one. <div className="mt-8 mb-16"> <button onClick={handlePurchase} type="button" // disabled='{this[id] <= 10}' className=&qu ...

Unable to locate '@material-ui/core/Alert'

I encountered an issue while trying to utilize the Alert component from material-ui. Despite successfully installing @material-ui/core, I keep receiving an error stating "Can't resolve '@material-ui/core/Alert'". package.json ''& ...

React - utilize a variable as the value for an HTML element and update it whenever the variable undergoes a change

I'm on a mission to accomplish the following tasks: 1.) Initialize a variable called X with some text content. 2.) Render an HTML paragraph element that displays the text from variable X. 3.) Include an HTML Input field for users to modify the content ...

A chosen class containing a nested class that utilizes the makeStyles function

Can someone explain how to target the 'element' when the root is selected? Here is the makeStyles code snippet: const useStyles = makeStyles(theme => ({ root:{ '&.selected': { } }, element: { } }) And h ...

Is there a way for me to position my arrow beside the header while still keeping the toggle function intact?

Can anyone assist me in positioning my arrow next to the header text, which I toggle on click? I attempted placing the arrow <div> into the H1 tag, but then the toggle function stops working. Any help would be greatly appreciated! Please includ ...

Discover the method to display only valid information

Within my database, I am attempting to locate an element labeled "newUser". The total number of elements stored in the database is 2. However, I am perplexed as to why I receive a result of true initially followed by false. Shouldn't the find method o ...

What could be the reason behind the "Package.json has missing dependencies" error message in create-react-app?

What's the issue: Recently, I began learning reactjs. In the process of creating a new react app, the build fails and only a package.json file is generated. > PS D:\react-projects> npx create-react-app app-name Creating a new > Reac ...

The parent element is not able to apply the CSS text-decoration in jQuery

Is there a way to retrieve a specific CSS property of an element, even if it is inherited from its parent? The standard jQuery method .css() can help with this. Consider the following HTML structure: <div id="container"> some text<br> ...

adjusting the size and positioning of an image within a parent div using React

Hey everyone, I'm a newcomer to the world of React. Currently, I'm working on a website and everything seems to be falling into place nicely. However, I've encountered a little hiccup. My goal is to write code within my SCSS folder that will ...

Difficulty changing paper background color with Material UI ThemeProvider

I'm currently working on a React frontend project using Material UI. I've created a basic Paper component and I'm trying to change its background color to match the primary color set in ThemeProvider. Here's the snippet of my code: impo ...

The mouseover and mouseleave functions remain active even during window resizing

I wish to create a dynamic menu that appears when hovering over a user, but only if the window size is above 977 pixels. Take a look at my code below: $(document).ready(function() { $(window).on("load resize", function(event){ var windowS ...

Combining two numbers retrieved from Firebase using React

Hello, I am new to React and finding it challenging to perform mathematical calculations with React. I have been attempting to add two values retrieved from a Firebase database, but they keep displaying as strings without adding the actual values together. ...

What's the reason why Angular stops flickering with the use of "/" in href?

Recently, I've come across a peculiar issue in one of my web applications while using Angular's routeProvider as a template engine. The app functions properly, but the behavior seems inexplicable to me. The problem arises during page transitions ...

Error encountered with TypeScript compiler when using a React Stateless Function component

I am attempting to create a React Stateless Function component using TypeScript. Take a look at the code snippet below: import * as React from 'react'; import {observer} from 'mobx-react'; export interface LinkProps { view: any; ...

Using React Router to transmit information

My React router setup is pretty straightforward: <Route handler={AppRoot}> <Route name="about" handler={About} /> <Route path="/projects" handler={Projects} /> <Route path="/projects/experiments" handler={Projects} /> & ...

HTML & CSS: Modify background rectangle behind text to limit its size within the webpage dimensions

I'm experiencing a unique issue with the current code present in my HTML index file. <div class="titleMessage"> <div class="heading"> <p class="main">NAME HERE</p> <p class="sub">Software Engineer& ...

Retrieving information from a TableRow element within Material UI

In the latest version of Material UI, I am utilizing a Table component but struggling to figure out how to fetch data from a selected row. The Table component's documentation mentions an onRowSelection prop that provides only the RowNumber of the sel ...