From 3e009bbf26a4fa84b268a3c0165cc7e7f4070489 Mon Sep 17 00:00:00 2001 From: Didier Korthoudt Date: Tue, 5 Apr 2022 10:37:42 +0200 Subject: [PATCH] Update CPSearchField.j This fixes problems with search and cancel buttons, restoring correct behavior and animations. --- AppKit/CPSearchField.j | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index 31f8f7d33..a601b3d83 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -122,8 +122,13 @@ var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotificat [self setContinuous:YES]; var bounds = [self bounds], - cancelButton = nil, // [[CPButton alloc] initWithFrame:[self cancelButtonRectForBounds:bounds]], - searchButton = nil; // [[CPButton alloc] initWithFrame:[self searchButtonRectForBounds:bounds]]; + cancelButton = nil, + searchButton = nil; + +#if PLATFORM(DOM) + cancelButton = [[CPButton alloc] initWithFrame:[self cancelButtonRectForBounds:bounds]]; + searchButton = [[CPButton alloc] initWithFrame:[self searchButtonRectForBounds:bounds]]; +#endif [self setCancelButton:cancelButton]; [self resetCancelButton];