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

Clearing Search terms from input field. #34

Open
byrnecore opened this issue Jan 13, 2014 · 3 comments
Open

Clearing Search terms from input field. #34

byrnecore opened this issue Jan 13, 2014 · 3 comments

Comments

@byrnecore
Copy link

I love the search function. Easy to use an all. One feature request would be clickable clear of search terms to revert to the original view before search terms was used.

Something like this perhaps.

http://jsbin.com/ekaZUR/1/edit

Obviously not urgent, but a UX nice to have.

Keep up the great work. love it.

@JangoSteve
Copy link
Member

I agree, this would be a good feature. I was thinking this could just be done with CSS and couldn't figure out why the demos didn't have the "x" icon. I learned that Bootstrap has removed the clear button to make styling look consistent in all browsers. So that explains that. It'd probably be a decent idea then to add a custom clear icon using CSS and JS in dynatable.

@JangoSteve
Copy link
Member

I added this functionality, but I'm not positive I want to merge it in just yet.

The main thing that bothers me is how the size and position of the "x" clear icon is styled independently of the search input itself. It looks great on the docs page, but if someone has their search input styled such that its size differs significantly from 1em, the icon will likely be placed oddly.

For example, here's what it looks like ideally:
screen shot 2014-01-14 at 11 22 29 pm

But, let's say my inputs have no padding and a small height, now it looks like this out of the box:
screen shot 2014-01-14 at 11 23 54 pm

I don't want developers to have to adjust the styling of the clear-icon for their site right after installing it.

This could probably be solved by using JavaScript to set the size and position of the clear-icon, but that's going to negatively affect performance of dynatable's init, which I don't want either. I may have to sit on this until I or someone else can spend a bit more time on it.

@JangoSteve
Copy link
Member

I just realized your jsbin might have the solution to the issues above. I'll have to look at it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants