fixes #18358, keyboard event handling with FilterDefDialog plugin

(cherry picked from commit bf7b7affb53741dabda1f2d996733e06241426d9)