Skip to content

Commit e34ae32

Browse files
committed
fix: incorrect reparenting
1 parent 6b148f6 commit e34ae32

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ios/SlackBottomSheet.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,29 @@ - (void)callWillTransitionShort {
138138

139139
- (void)layoutSubviews {
140140
[self setPresentGlobally:_presentGlobally];
141+
[self setVisible:_visible];
141142
[super layoutSubviews];
142143
}
143144

144145
- (void)setPresentGlobally:(BOOL)presentGlobally {
145-
outerView = presentGlobally ? nil : self.reactSuperview;
146+
outerView = presentGlobally ? nil : self.superview;
146147
_presentGlobally = presentGlobally;
147148
}
148149

149150
- (void)setVisible:(BOOL)visible {
150151
_visible = visible;
151152
[self setPresentGlobally:_presentGlobally];
152153
if (visible) {
153-
if (self->addedSubview == nil) {
154-
return;
155-
}
156154
RCTExecuteOnMainQueue(^{
155+
if (self->outerView == nil && !_presentGlobally) {
156+
return;
157+
}
157158
if (self->_modalPresented) {
158159
return;
159160
}
161+
if (self->addedSubview == nil) {
162+
return;
163+
}
160164
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
161165
object_setClass(self->addedSubview, [HelperView class]);
162166
[(HelperView *)self->addedSubview setBridge: self->_bridge];

ios/UIViewController+PanModalPresenter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PossiblyTouchesPassableUIView: UIView {
4747
override func layoutSubviews() {
4848
super.layoutSubviews()
4949
let outerView = self.config?.value(forKey: "outerView") as? UIView
50-
if (outerView != nil) {
50+
if (!(self.config!.value(forKey: "presentGlobally") as! Bool)) {
5151
removeFromSuperview()
5252
let helperView: UIView = self.subviews[1].subviews[0]
5353
let bounds = outerView!.bounds

0 commit comments

Comments
 (0)