PathOfBuildingCommunity / PathOfBuildingCommunity/PathOfBuilding

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

Đang mở
#2,773 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@Wires77 đang làm issue này rồi.

Từ ngày 13/5/2021.

enhancement technical
Ngôn ngữ chính
Lua
Star
5.4k
Fork
2.4k
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
26

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.