Skip to content

Conversation

@harshanasrimal
Copy link
Contributor

When managing a large number of devices, selecting the correct one from a long dropdown list is difficult and time-consuming.

Improvements

  • Added a search ability to the multiple enabled selection field.
  • Made the device dropdown in reports searchable, allowing users to quickly filter and find devices.

Benefits

  • Improves usability when handling many devices.
  • Reduces time spent scrolling through long dropdowns.
  • Provides a smoother and more efficient reporting workflow.

@tananaev
Copy link
Member

Please provide a screen recording.

@harshanasrimal
Copy link
Contributor Author

Please provide a screen recording.

please refer the google drive for the screen records. I uploaded both old and new method there.

Google Drive Link

@tananaev
Copy link
Member

Can you select more devices and see what happens to the field if it doesn't fit?

@harshanasrimal
Copy link
Contributor Author

Can you select more devices and see what happens to the field if it doesn't fit?

image

it expands the field. similar way the current connection input work.

@tananaev
Copy link
Member

This is obviously not what we want in this case.

@harshanasrimal
Copy link
Contributor Author

This is obviously not what we want in this case.

It really helpful if we have the search feature within this field. Do you have any suggestion to implement this in a better way? Its a really helpful feature.

If you have any better UI suggestion, I'm happy to implement.

@tananaev
Copy link
Member

I think it should look similar to what it looks like now without stretching the field. I don't know how to implement it and that's exactly the reason we're not using autocomplete there. We already tried, but it doesn't work well.

@harshanasrimal
Copy link
Contributor Author

will try to implement without loosing current design

@jinzo
Copy link
Contributor

jinzo commented Aug 23, 2025

So, the main problem is there was nothing that would fit good implemented in mui. Did not check recently, but I was looking for something like select2:
image
Where the 'first' item is actually a search box. MUI stuff is flexible enough that this should be possible to implement on top of it/using standard components. But I was unable to do after a few tries - and then gave up. But good luck!

@harshanasrimal
Copy link
Contributor Author

I have another doubt regarding this. lets assume we implemented this. how we unselect selected items?

I was thinking that if we could sort the list and move selected items to the top, then it will be easier to deselect.

It just an idea. let's see how we could implement this.

@tananaev
Copy link
Member

You can un-select using the same search. I don't want to overcomplicate it.

@harshanasrimal
Copy link
Contributor Author

how user know selected devices when he has 1000 devices and more than 10 selected?

according to the design as we wrap selected list, It will be harder. is that okay?

@tananaev
Copy link
Member

They selected those devices. They can de-select exactly the same way.

@harshanasrimal
Copy link
Contributor Author

That’s a good point. I will try to implement it in that way

@harshanasrimal
Copy link
Contributor Author

@tananaev I made some changes and I hope this design looks fine.

image

@tananaev
Copy link
Member

Looks better. Is it ready for review?

@harshanasrimal
Copy link
Contributor Author

Looks better. Is it ready for review?

yes please

@harshanasrimal
Copy link
Contributor Author

@tananaev please allow me to modify the code and request review again. I will combine all and implement a single search. that would be better.

}}
renderInput={(params) => <TextField {...params} label={label} placeholder={getPlaceholder()}/>}
disableCloseOnSelect={multiple}
slotProps={{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we override renderValue instead of doing this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually can we render selected items using renderValue? Instead of using placeholder for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we use renderValue, it replace the render input behaviour and try to render two elements within the AutoComplete element (value div and input element) which cause to ui issues because in that case, it contains 2 flex divs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it cause issues exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in normal behaviour, the value render as the input element but when we use renderValue, it create another <div> alongside with input element. let me share a screenshot with a better comparison

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-08-26 at 22 07 06

Its the normal behaviour and you see the value is rendered within the input element (as value parameter of the input)

And when we use renderValue it render the value separately instead rendering it as value of the input element.

Screenshot 2025-08-26 at 22 14 18

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that's kind of what we want. We just need to make sure it doesn't overflow.

Copy link
Contributor Author

@harshanasrimal harshanasrimal Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have to implement the element manually. There are some other issues like where cursor will be when we have separate renderValue and input. I will try when I get a free time

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

Successfully merging this pull request may close these issues.

3 participants