PathOfBuildingCommunity / PathOfBuildingCommunity/PathOfBuilding

Update build search field to not run a full file search on each keystroke

Open
#2,773 0 comments 0 reactions 1 assignee View on GitHub

@Wires77 is already working on this.

Since May 13, 2021.

enhancement technical
Dominant language
Lua
Stars
5.4k
Forks
2.4k
Avg merge
1d 12h
Merged PRs (30d)
26

Description

You can also do it like this to use a changeFunc instead of enterFunc. This does run NewFileSearch for every keypress, though, which obviously can feel a bit more laggy. What you could do here to minimize that lag is instead of having this function call self:BuildList(), it could create the list with all builds, loop through that list in this changeFunc, and build a filtered list that it assigns to self.list for the build list to use.

That latter bit could be a separate PR, but if you could do it here that'd be great. I do think using a changeFunc instead of enterFunc is more consistent with other lists, though.

	self.controls.searchText = new("EditControl", {"TOP",self.anchor,"TOP"}, 0, 25, 640, 20, self.filterBuildList, "Search", "%c%(%)", 100, function(buf)
		main.filterBuildList = buf
		self:BuildList()
	end)

Originally posted by @Wires77 in https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/2546#discussion_r617007653

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.